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)

0
votes
0answers
3 views

Standard Rails way of implementing customisable site functionality

We have a Rails web application that allows users to purchase access to combinations of our sites functionality. The exact business scenario is rather complex but a SSCCE would be as follows: ...
2
votes
1answer
21 views

Where to store configuration URL variable in Rails?

I have an external ecommerce link that varies based based on environment (testing and production systems). Where should it go in Rails? Possibilities include: a conditional directly in the ...
0
votes
1answer
45 views

database architecture for ecommerce app

I’m creating an app that allows users to post, sell, and purchase items. Every item has a count integer attribute that is set by the initial user and which is reduced by n with each purchase. When ...
-1
votes
0answers
13 views

Rails schema showing duplicate add_index lines after migrations

In Rails, I have this odd issue where after I migrate, my schema shows duplicate add_index lines, which then causes my rspec tests to throw the error: ArgumentError: Index name 'name_here' on table '...
-3
votes
1answer
46 views

Web framework to consume external API [closed]

I'm currently joining a project in which there's a core REST API already developed which is used for a mobile app. The next step will be to build a web app which should also consume the API. My doubt ...
4
votes
1answer
122 views

Increase code duplication to simplify business rules in views

I am in the process of writing a Ruby on Rails web application for my university's department. For some of our resources in the web application, e.g. Project, are complex with their view layer logic: ...
-1
votes
0answers
59 views

Using ajax to make pages seem more responsive as an alternative to Angular?

AngularJS, Ember and React are all the rage these days. I get their appeal and as much as I'd like to learn them I just don't have the time. I'm writing an unsophisticated application that can be ...
5
votes
7answers
1k views

Should I keep separate client codebases and databases for a software-as-a-service application?

My question is about the architecture of my application. I have a Rails application where companies can administrate all things related to their clients. Companies would buy a subscription and their ...
1
vote
1answer
175 views

What's the best practice for adding a lot of attributes to a Rails model?

So, I'm building an API wrapper gem that works with Spree's Product model. The API provides extensive customization of the data you send to it. I would like a user of the gem to be able to take ...
0
votes
0answers
64 views

Should Rails views actually render anything?

I've joined a Rails app with hundreds of pages and no tests, first thing I've done is set us up with model-, controller- and feature-tests and I'm adding them as I work on areas. One thing I'm ...
0
votes
0answers
22 views

Schema design (SQL) for incorporating an alerts system tied to users

I've been working on an app to hone my skills while building something that will be useful to me. It's being built using Ruby on Rails, but this question is mostly language agnostic. I'm currently ...
17
votes
5answers
3k views

When to use inheritance, when to use 'just a boolean field'?

In our Rails application, we are adding notifications. Some of these are blocking: They stop the progress of whatever resource they are added on, because some information on that resource is missing. ...
3
votes
2answers
48 views

Rails' MVC vs Microsoft MVC - where to put logics?

Some time ago I switched from Microsoft ASP.NET 2.0 (WebForms, never knew Microsoft's MVC) to Ruby on Rails and learned it's MVC approach, after which some things in ASP.NET MVC seem to be weird. In ...
2
votes
0answers
55 views

Rails on AWS Elastic Beanstalk - limitations

I have been looking at AWS Elastic Beanstalk service for the deploymeny of my rails application, and I came to think it was actually a bad idea given some specific requirements of my application. But ...
1
vote
1answer
76 views

Database integration of Rails and Laravel apps

I have some very small apps on a VPS running ruby on rails and a co-worker also have some of his own apps running on laravel at another VPS. So far we dont needed to share any data among the apps, but ...
0
votes
0answers
40 views

How to understand code of Rails app written by other devs and test it accordingly?

Rails beginner here with less than year experience in programming.I have some experience writing trivial Rails apps (with CRUD implementation like simple blog) and I have some knowledge how to write ...
2
votes
0answers
57 views

Best way to build a JSON API coupled with HTML views in a Rails project

I've got a Rails eCommerce project communicating with an iOS app. The iOS app receives JSON data from the Rails back-end, but there's also HTML rendering when a user comes to the project from his ...
0
votes
0answers
14 views

Regional test-of-concept environment, whose database must be merged back to the main server afterwards

My client wishes to launch a specific version of the Rails platform I am developing that will be restricted to a particular group of users (some sort of test-of-concept). I will have another server ...
3
votes
1answer
244 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 ...
1
vote
1answer
96 views

Ruby: Abusing mixin

I'm currently working with some code that IMO has abused ruby's mixin features. Given that I'm new to ruby, I wonder if MO in IMO is correct or not. My primary question is what makes more sense (and ...
1
vote
2answers
172 views

MVC - Database search logic in View or Model

Special Note: I asked a very similar question on Stack Overflow, but I have since decided the problem should be solved from a design standpoint rather than an implementation standpoint. I have ...
13
votes
10answers
1k views

How to convince teammates to use TDD [closed]

I am the only person on my team that use TDD. How do I make them to use it? I am annoyed that when I pull, someone's code will break my tests and I am the one who has to fix them. Will using github, ...
2
votes
2answers
223 views

Does RESTful response always return a 404 and empty content when an array is expected but the result is empty?

I worked with Ruby on Rails and RESTful api before and now with Django Rest framework. For this question let's say we only consider the case of JSON but not XML. It seems that when we expect an ...
1
vote
2answers
1k views

How do I read API documentation? [closed]

I've been trying to read through the RoR API to try to learn things that the tutorial missed, and I haven't been able to follow it at all. The only time I've read documentation was when I needed to ...
2
votes
3answers
179 views

Using multiple languages

I currently have a website running PHP laravel. We came to a point where we want to add a user-backend -- where users sign-up and can access functions when logging in. My question is; Is it possible ...
3
votes
1answer
193 views

How to implement a (truly) global variable in a Rails app

How can I best implement a global counter in a Rails API app? (A central component in a system with several.) Basically I have a transaction id I need to increment and roll over past a maximum value. ...
1
vote
0answers
43 views

Why separate routes and controllers in MVC backend applications?

I've dabbled in a few MVC frameworks (like Rails and its ilk) and I've noticed that the file that defines restful routes often go separate from controllers which hold the actions executed through ...
6
votes
4answers
4k views

Ruby on rails not popular in big international IT companies? [closed]

Is the ROR used only in startups or also in bigger companies as well? What should be the reasons of their preference of Java over ROR?
1
vote
1answer
217 views

How does a competition like Rails Rumble Work?

I am not sure weather it is a proper question to ask out here but it is really bothering for a while. As the official website writes: The Rails Rumble is a distributed programming competition ...
4
votes
1answer
64 views

Adding permission levels in Rails

So I'm making a bug tracker to help me learn Ruby on Rails. My current setup is something like this: Each Project has_many :metadata and has_many :permissions, through: :metadata. Also some other ...
1
vote
2answers
114 views

Using self.method vs the scope :method DSL

According to the Thoughbot Rails Style Guide, we should Use def self.method, not the scope :method DSL. My question is: is this simply for the sake of choosing one of these styles and sticking ...
-2
votes
2answers
97 views

Tables vs. Booleans: Which of the two are more secure for setting admin roles in an app? [closed]

I'm currently in the process of setting up roles where there are regular users, admins, and super admins, each of which have special permissions. I deferred to this post on how to do so. It ...
2
votes
1answer
191 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 ...
0
votes
4answers
634 views

Should I use TDD and BDD if my project is changing fast?

I have my own little project I am creating using RoR, I plan it to have small-medium load. With no doubt I started with BDD and TDD (Cucumber and RSpec to be exact, but I am also experienced with ...
7
votes
1answer
739 views

How to keep up with the Rails world? [closed]

How should I keep up to date with the ever-changing Rails community? I have been trying to learn Rails off and on for a year now and the brick wall I keep running into is the fact that I'm trying to ...
6
votes
2answers
8k views

Why do people suggest not to use instance variable for views in Ruby on Rails

Why do I hear that it is not good to share instance variables between controllers and views. I kind of like it because I can see immediately via the @ that something is coming from the controller. I ...
1
vote
1answer
162 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 ...
3
votes
1answer
149 views

Switching CSS to use asset pipeline in Rails?

I have a lot of legacy CSS files from what was a Rails 2.x app that got upgraded to Rails 3.2.8, and I want to switch over to using the Rails asset pipeline for stylesheets. The issue is, the CSS ...
4
votes
2answers
3k views

Ruby on Rails database using static lookup tables or constant strings

In some ruby on rails projects, I have seen instances where strings are used instead of a foreign key reference to a lookup table. I usually code in C#/SQL Server and use lookup tables, but am not ...
1
vote
1answer
215 views

Where does Rails get its 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 its inner workings to be able to say for sure what I ...
0
votes
1answer
272 views

Best way to design a database interface [duplicate]

This is my situation I have a website, mobile client and desktop client. They can all pretty much do the same operations (website might be able to do more now but in the future they might have the ...
3
votes
1answer
157 views

Can a model have itself as a foreign key?

I am doing a coding project in rails. I have a user model, and I want to add a "spouse_id" to it (which would reference other users). Can a model reference itself in a foreign key?
11
votes
5answers
5k views

Are RSpec and Cucumber really worth it?

I know most RoR programmers are testing addicts and I understand the advantages of a large testing suite but when I start testing, I never get such a large suite and I always wonder "Am I testing the ...
1
vote
1answer
157 views

Rails validation: Which method is preferred

In Ruby on Rails there are two ways to validate, for instance, the presence of input fields. Say I want to make sure the user has filled out my fields called value and name. I could put in my model ...
3
votes
1answer
1k 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! ...
14
votes
1answer
10k views

Reasons for a Java Developer to learn RoR [closed]

Just wondering if there are any reasons why a Java developer should learn Ruby on Rails knowing that there are technologies such as Grails or (especially) Spring Roo that can be more familiar?
4
votes
5answers
15k views

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

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 ...
2
votes
5answers
473 views

MVC - Checking data in the model or the controller?

I'm currently creating a web application with Ruby on Rails and I'm facing an conceptual problem about the MVC pattern. If I need to check, for example, if the name of a data that I want to add in ...
4
votes
3answers
1k views

Rails 2.x and conventions vs. “enterprise” architecture

Note: this is from the spring of 2008, thus ancient in rails land. (The title for this probably isn't as good as it should be, I cannot think of a better one) I am about to revisit a startup idea ...
4
votes
1answer
5k 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?