Ruby on Rails is an open-source web development framework optimized for programmer happiness and maintaining sustainable productivity. Many things are defined by convention, freeing you from having to re-invent things to stay productive.

learn more… | top users | synonyms (1)

3
votes
1answer
2k views

What is a closure and how is it implemented in Ruby?

In the context of the Ruby programming language, what is a closure and when do you use one? What are the uses for it in Rails?
-2
votes
0answers
55 views

Django vs Rails for SaaS Startup [closed]

Several friends and I have a SaaS idea we want to flush out and build a prototype. We have already decided on AngularJS for the front-end, so we need to find a framework that plays well with ...
0
votes
1answer
76 views

Change of session/context in rails application

I'm currently developing an app in Ruby on Rails with a social network side, and have several different models including users, groups and pages. I would like to allow users to be group/page admins, ...
-2
votes
1answer
58 views

PHP vs ROR for AJAX and responsive design [closed]

I'm in the planning phase of making a website for calculating various mathematical problems, as a school/sparetime project with a couple of friends. We're gonna start off with implementing a "right ...
0
votes
0answers
23 views

Incorporating web designer's into a rails app

I have a designer who has great knowledge of HTML, CSS and JavaScript (Not jQuery or AJAX though). He gives me his designs in those files and I have to incorporate it into my apps. The site is not ...
1
vote
0answers
22 views

Rendering head :ok vs head :no_content. Any good practices?

Whenever I take in data and do something like delete a post, etc. I generally return head :no_content. For example: def destroy @post = Post.find_by(external_id: params[:post_id]) @post.destroy! ...
1
vote
1answer
49 views

How do rails project know about rake tasks from other repositories

We have a rake task called db:sanity_check which exists in a 'core' repo. Other repositories that we have also show this rake task. But they do not define the rake task. It 'comes' from core' How ...
2
votes
2answers
90 views

Where to load data for things like a sidebar in MVC frameworks?

This seems extremely basic, but I've read a lot of related questions and haven't found a proper answer. Using Ruby on Rails or other similar MVC framework, how am I supposed to load data that is ...
2
votes
3answers
495 views

Sharing business logic between server-side and client-side of web application?

Quick question concerning shared code/logic in back and front ends of a web application. I have a web application (Rails + heavy JS) that parses metadata from HTML pages fetched via a user supplied ...
0
votes
0answers
63 views

How to scrub Twitter and Facebook posts for many users

I'm making an Rails app that in theory should scrub new posts from the users facebook and twitter accounts and put them in a timeline for an analyst to analyze and determine if they are good or bad ...
1
vote
2answers
141 views

Architecture to handle service concurrency on resources exposed via REST API [closed]

REST API frameworks like Python Eve handle concurrency control via an entity tag. This ensures that several clients which loaded the same resource will not overwrite the changes of each other, because ...
1
vote
1answer
93 views

Should I be writing feature or request specs?

I've been writing model specs for a while now and I'm gradually moving towards integration testing. Right now, I'm looking at the best way to test the output of my ActiveAdmin dashboard but I'm unsure ...
1
vote
1answer
97 views

Should I use expect or should when writing RSpec specs? [closed]

Please can someone explain to me how I should go about deciding whether to use expect or should syntax for my rspec examples. From my understanding we should no longer be using the 'should' syntax. ...
1
vote
1answer
250 views

How can I estimate hosting costs on Heroku into the hundreds of thousands of users?

Heroku's pricing page is clear when looking at what I'm paying and what I'm getting, but it is not helpful for predicting future costs of an app. If I have an app that is still being developed, how ...
5
votes
2answers
442 views

Start reading Ruby (on Rails) code [closed]

I'm an experienced developer which quite some experience in meta programming. I just found my way to Ruby and want to understand more of Rails (and related) project internals. Even if I understand the ...
0
votes
1answer
58 views

Calculate which quantity packages to use based on quantity of bookings

In my app, many appointments can be booked for activities. Each activity has many price packages with a price and a quantity. On showing the cart, I need to work out what combination of packages ...
0
votes
1answer
41 views

Ruby on Rails application interfacing with a Datamax barcode printer [closed]

I am trying to find a standalone way to interface with a Datamax M-Class Mark2 label printer through a Ruby on Rails application. I currently have a solution that is working, which i use javascript to ...
0
votes
1answer
127 views

Refactoring a Single Rails Model with large methods & long join queries trying to do everything

I have a working Ruby on Rails Model that I suspect is inefficient, hard to maintain, and full of unnecessary SQL join queries. I want to optimize and refactor this Model (Quiz.rb) to comply with ...
2
votes
0answers
93 views

Splitting up a Rails/Ruby app onto multiple servers

We recently moved a large application to two machines, both running the same codebase. I. Machine A Web server for public facing application Receives web hook call backs from our ESP Handles a ...
0
votes
0answers
21 views

An efficient + extendable way to store/reference a normalized set of “causations”?

I'm looking for a good way to define and store references to a normalized set of "causations". I have a well-defined set of reasons (short, descriptive strings) why certain objects are created and ...
1
vote
1answer
211 views

Rails Google Cloud Messaging with heroku

I'm looking at using GCM to send notifications from my rails app to an Android app. The getting started guide says: In the resulting configuration dialog, supply your server's IP address. I'm using ...
1
vote
1answer
27 views

A container only assets in Rails

I have multiple segmented Rails apps that are connected to each other: App A App B App C While I try to keep the design, such as header and footer, to look similar, but each app has its own ...
4
votes
5answers
11k views

Real-time chat in Ruby on Rails without owning a server

I'd want to implement a Real-time chat for my Rails app but I can't really host the server which handles the sockets. I've tried Faye but it needs a server. I've also heard of pusher but it's limited ...
10
votes
5answers
4k views

Are RSpec and Cucumber really worth it?

I'm a quite new programmer to Rails (about a year) always trying to discover new gems, new ways of thinking, I just love this framework. The only thing that's kind of disturbing me is testing. I know ...
1
vote
2answers
234 views

Need advice on design in Ruby On Rails

For personal educational purposes I am making a site for a conference. One of the object that exist in a conference is a session, which has different states and in each state it has slightly different ...
-1
votes
1answer
73 views

Web app that runs other applications? [closed]

I am trying to write a web application that interacts with a service that would run scripts at the system level. Something like a website that you can schedule a job, the service will run the job with ...
1
vote
0answers
89 views

Serialized values or separate table, which is more efficient?

I have a Rails model email_condition_string with a word column in it. Now I have another model called request_creation_email_config with the following columns admin_filter_group:references ...
2
votes
0answers
80 views

Do Rails Join Models Get Controllers?

I have a rails app where my users can buddy up with other users. Since that relationship can have a status (approved/rejected/pending), I decided to go with a join model (UserRelationship) so now I ...
2
votes
2answers
248 views

Is is OK to use a non-primary key as the id in a rails resource?

I am getting ready to set up a resource for some new api calls to my rails application. I am planning on calling the resource devices ie resources :devices This is going to represent android ...
-1
votes
2answers
68 views

Embedded Model Designing — top down or bottom up? [closed]

I am trying to learn RoR and develop a webapp. I have a few models I have thought of for this app, and they are fairly embedded. For example (please excuse my lack of RoR syntax): Model: textbook ...
1
vote
1answer
64 views

How to Structure a Trinary state in DB and Application

How should I structure, in the DB especially, but also in the application, a trinary state? For instance, I have user feedback records which need to be reviewed before they are presented to the ...
1
vote
2answers
473 views

Inspecting the model in a Rails application

I am learning some Ruby on Rails, and am a newbie. Most of my background is in ASP.net MVC on the back end. As I play with a basic scaffold project, I wonder about this case: you jump into an ...
4
votes
5answers
2k views

What is a practical way to debug Rails?

I get the impression that in practice, debuggers are rarely used for Rails applications. (Likewise for other Ruby apps, as well as Python.) We can compare this to the usual practice for Java or ...
1
vote
1answer
80 views

Where does Rails get it's datetime for creating records?

I have a rails app with a data model called 'jobs' and i'm faced with a critical design choice crossroads. I don't know enough about Rails and it's inner workings to be able to say for sure what I ...
62
votes
16answers
6k views

How much freedom should a programmer have in choosing a language and framework?

I started working at a company that is primarily C# oriented. We have a few people who like Java and JRuby, but a majority of programmers here like C#. I was hired because I have a lot of experience ...
4
votes
3answers
1k views

How can web development bootcamps deliver on their promise? [closed]

I came across the concept of web development bootcamps, these 9-10 week intensive crash courses claim to teach beginners web development and help them get 80k starting salary jobs. Many of you might ...
0
votes
2answers
252 views

help me understand Rails and attributes as class methods

This is from the Hartl Rails tutorial. We are automatically logging in a user in the process of creating that user with a callback to #create_remember_token. It works great but there are some things, ...
0
votes
1answer
217 views

Rails engine testing - use dummy app or real parent app?

I'm using Rails engines to break up a big app into smaller pieces. The parent app mostly handles users and authentication. In one of my engine tests I want to log in a user before each test. How ...
0
votes
0answers
50 views

One huge rails webapp or many small webapps?

We have a huge system to develop, it has 3 main functions: API provider Worker to automated data retrieval Management of data built in workers They all share the same DB, but for scalability ...
0
votes
0answers
76 views

Ruby on Rails - branding

I am working on a website, which is to have multiple brands. The core functionality for all brands will be the same, however there will be a number of differences between them. Those differences may ...
2
votes
1answer
3k views

Rails - How to use modal form to add object in one model, then reflect that change on main page?

I'm working on a Rails app and I've come across a situation where I'm unsure of the cleanest way to proceed. I posted a question on SO with code samples and such - it has received no answers, and the ...
0
votes
0answers
58 views

Extracting models into a external dependency

About 9 months ago, I asked a question about creating a service layer for my application. Unfortunately, in the ensuing time, no progress in that area was made, primarily due to time constraints. As ...
0
votes
1answer
236 views

Create a loop that visits every link on a site [closed]

I want to create an HTML scraper in Ruby on Rails and I want to implement a progress bar and an ability for it to pick up where it left off if it's interrupted while scraping. I think the best way to ...
23
votes
2answers
10k views

We have a large Ruby on Rails application (25 million monthly users), our management decided to rewrite in Node.js, am I crazy?

Please tell me if: Node.js will make our site faster! Node.js will consume fewer server resources, we can save money! Node.js will make us more productive! Node.js means we can share client and ...
1
vote
4answers
254 views

If I use Ruby Migrations, do I have to use the rest of Ruby on Rails?

I'm currently trying to come up with a database migrations strategy for my organization. This includes getting the database scripts into source control, managing versioning, managing releases to QA / ...
1
vote
3answers
250 views

Why does Rails do config in code?

According to the Pragmatic Programmers, code should be for abstractions, while configuration and details should live in metadata. Rails seems to diverge dramatically from this pattern. Much config is ...
1
vote
1answer
208 views

Should an object update itself?

I'm working on Ruby on Rails. There is a feature in our app where doctors can "claim" cases for themselves. I can either have the doctor perform the action and update the plate, or I can have the ...
-2
votes
1answer
4k views

Advantages and disadvantages of PHP/Ruby [closed]

I've been a front-end developer for about two years now, and I'm attempting to break into the server side of things. Ideally I'd like to work for a startup social network on the back-end side so I ...
8
votes
4answers
4k views

Why was Rails written in Ruby? [closed]

I know PHP and Ruby. Using a PHP Rails clone (not out of choice), called Symfony, (which is apparently the best PHP framework), I notice that it's a clone of Rails. I think Symfony is stupid and ...
1
vote
0answers
81 views

Rails: get data about a model collection, with new model or method?

have a model Product with attributes sales, views and I need to get sales/views count of all products, in this case is more correct to implement this things as method and have a call like ...