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
1answer
47 views

Best way to design a database interface

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 ...
-4
votes
0answers
32 views

To use or not 3NF [on hold]

I have a question about using or not 3nf on databases and especially in relation to ruby programmers out there. Do you think 3nf should be used as often as possible and how hard is it to use in ruby ...
1
vote
1answer
37 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 ...
0
votes
1answer
118 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, ...
0
votes
0answers
3 views

NameError on executing 'rails s' [migrated]

I just started this tutorial for Rails. I just created the app and was going to test the default welcome page and this happened: D:\Programming\Rails Projects\simpleCMS>rails server ...
3
votes
1answer
61 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?
10
votes
5answers
4k 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
65 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
454 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
9k 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
14k 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 ...
1
vote
5answers
238 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 ...
12
votes
10answers
987 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, ...
4
votes
4answers
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
3k 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?
0
votes
0answers
330 views

Online stores service design [duplicate]

I am designing an online store service app with rails. Everyone who wants to make his/her own store can do it with this app by just signing up and choosing a domain. I want to make it as SaaS as it ...
2
votes
0answers
132 views

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

I have a model Product with attributes sales and views. I need to get sales/views count of all the products. Is more correct to implement this as a method and have a call like Product.all.sales or ...
1
vote
2answers
111 views

Is there a better pattern for a form object populating itself in 3 different ways?

So I'm writing a form object that deals with a specific thing - price - which is going to be included in several different underlying resources. (The Price is a separate model that may or may not need ...
1
vote
2answers
289 views

Is setting “permanent” persistent login cookies a bad practice?

I realized that in Rails there is a built in permanent method for its persistent login cookies (aka. "remember me" cookies) method to give the client a cookie that expires in 20 years: ...
2
votes
3answers
162 views

Which is the convention in Rails to perform calculations and display the results?

So I'm working on a personal project on Rails to learn more about this framework, and I wanted to add a feature in which the user choose a particular record from the view, and after some calculations ...
3
votes
1answer
241 views

Any way to use VoltDB in rails app?

I've been curiously looking at VoltDB and one year ago I have even seen a gem that was providing Ruby connection to VoltDB. I have checked today again and it seems gone. I'm planning to go through ...
1
vote
1answer
85 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 ...
3
votes
2answers
257 views

S3 image urls in database

I have an application where users will be able to upload multiple images for one Product (via something like Ryan Bates nested fields, so you'd click "Add Image", and a file upload would appear on the ...
50
votes
6answers
6k views

Should Latin-1 be used over UTF-8 when it comes to database configuration?

We are using MySQL at the company I work for, and we build both client-facing and internal applications using Ruby on Rails. When I started working here, I ran into a problem what I had never ...
5
votes
5answers
2k views

How can I move from Java and ColdFusion to Ruby on Rails? [closed]

Currently I work with ColdFusion 9+ and some Java in a Windows environment. Prior to ColdFusion, my background was in Java and JSP. I'm considering a move towards Ruby on Rails, as I think it would ...
1
vote
0answers
42 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 ...
-1
votes
1answer
180 views

Is there any harm in using amazon AWS as a development environment? [closed]

What modifications do I need to make to my workflow, and which skills do I need to learn in order to develop with Ruby On Rails on a Linux cloud server on Amazon Web Services (AWS)? In particular, I ...
1
vote
0answers
90 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 ...
3
votes
7answers
8k views

How much Ruby should I learn before moving to Rails? [closed]

Just a quick question.. I can never get a definitive answer when googling this, either. Some people say you can learn Rails without knowing any Ruby, but at some point you'll run into a brick wall and ...
2
votes
3answers
294 views

Questions for Architecture with Ruby and Java [closed]

I am in the research phase of a project that needs to make use of 3rd party libraries that are in Java so I am stuck using Java to at least a small degree. I am considering implementing Ruby as the ...
0
votes
1answer
188 views

ActiveRecord equivalent in Java [closed]

My question is fairly simple.. What is the closest ORM to ActiveRecord that I'd be able to find for Java? In other words, in terms of thinking patterns and knowledge, with limted development time, ...
-1
votes
1answer
96 views

Is obsolete to study older versions of Ruby and RoR? [closed]

I want to study Ruby and RoR for some things I'll have to make, but almost every book, videos or any kind of source I find is outated, where the most current book I could find (link here) is one of ...
-2
votes
1answer
130 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 ...
1
vote
1answer
67 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
429 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
709 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 ...
1
vote
0answers
93 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
1answer
179 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
224 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. ...
5
votes
2answers
523 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
71 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 ...
1
vote
1answer
77 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
218 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 ...
3
votes
0answers
181 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 ...
2
votes
1answer
518 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
34 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 ...
2
votes
2answers
250 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
78 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 ...
2
votes
0answers
131 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 ...
3
votes
0answers
145 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 ...