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

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
54 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?
-1
votes
0answers
16 views

Setting up X-editable library [migrated]

I intend to implement in line editing for my objects and I want to use X-editable library for that purpose but documentation is not clear enough to me. As much as I understood the documentation ...
1
vote
1answer
44 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 ...
1
vote
5answers
196 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 ...
0
votes
0answers
27 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 ...
1
vote
2answers
101 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
256 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
150 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
229 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
0answers
38 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 ...
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 ...
-1
votes
1answer
169 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
86 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
1answer
180 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, ...
3
votes
2answers
245 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 ...
-1
votes
1answer
91 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
126 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
1answer
74 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
1answer
403 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! ...
2
votes
2answers
371 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 ...
1
vote
0answers
91 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
66 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 ...
1
vote
1answer
170 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
214 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. ...
0
votes
1answer
70 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
74 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
0answers
28 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 ...
3
votes
0answers
172 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 ...
1
vote
1answer
33 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 ...
0
votes
1answer
205 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
1answer
503 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
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 ...
3
votes
0answers
137 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
votes
2answers
93 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
87 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
1answer
138 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 ...
2
votes
0answers
129 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
2answers
468 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 ...
0
votes
1answer
480 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
1answer
113 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
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 ...
0
votes
1answer
402 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 ...
1
vote
3answers
254 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
229 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
6k 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 ...
2
votes
0answers
125 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 ...
3
votes
1answer
2k 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 ...
0
votes
1answer
399 views

Is api user authentication with oauth possible for both email/pw and 3rd party services

I have an api only application (rails-api) and I'm looking to authorize a user on both email/password or 3rd party services like facebook or twitter etc, so I know I will have to use Oauth at some ...
2
votes
1answer
135 views

How to create html pages which don't change very much and not very often?

I have a Rails server that connects to a json API on another server to get data to build the pages dynamically. These pages, however, don't change very much and not very often. I was thinking I could ...