Questions tagged [ruby-on-rails]

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.

Filter by
Sorted by
Tagged with
0
votes
1answer
872 views

model association or controller?

I'm trying to create a rails app that allows users to submit information about their pets. I've come to a point where my knowledge is limited and I don't know enough about what/how this could be done ...
37
votes
7answers
34k views

What ASP.NET MVC can do and Ruby on Rails can't? [closed]

ASP.NET MVC and Rails have similar area of use, are built around same architecture, both frameworks are relatively new and open source. So as a Rails programmer I'd like to know, what ASP.NET MVC can ...
16
votes
13answers
2k views

How can I defend Ruby on Rails against customers' not technical opinion?

My customer, a translations business owner, just told me that he has been reading about Ruby on Rails and told me that "there are more PHP guys around there" and "it seems the community prefers it". ...
0
votes
0answers
26 views

Rails: The Law of Demeter [duplicate]

I am reading a book called Rails AntiPatterns and they talk about using delegation to to avoid breaking the Law of Demeter. Here is their prime example: They believe that calling something like this ...
0
votes
2answers
2k views

Rails/Node.js interaction

I and my co-worker are developing a web application with rails and node.js and we can't reach a consensus regarding a particular architectural decision. Our setup is basically a rails server working ...
13
votes
4answers
2k views

Rails: Law of Demeter Confusion

I am reading a book called Rails AntiPatterns and they talk about using delegation to to avoid breaking the Law of Demeter. Here is their prime example: They believe that calling something like this ...
2
votes
1answer
935 views

Rails: Useful example of delegate and Law of Demeter

I am currently learning about delegate and the Law of Demeter. I understand the Law of Demeter, but I can't seem to find a good example of where using delegate to avoid breaking the law would actually ...
0
votes
0answers
721 views

Creating a new database with Active Record

Please tell me if this is mad, but basically, I've created a custom rake task, and before it does its thing, it gives the user a warning message: Warning, please back up your database before ...
0
votes
1answer
1k views

How to handle licensing of Ruby on Rails code, which contains a LGPL library?

My company wants to release the code for a Ruby on Rails demo app, which includes our own LGPL'd library code. It it legally kosher for me to state that the contents of the entire repo are released ...
17
votes
10answers
17k views

Is Ruby on Rails supposed to have a steep learning curve or is it just me? [closed]

I'm a self-taught programmer. I've been learning RoR since October with varying intensity (sometimes all day, sometimes nothing for several weeks). Before that I knew only Java, but knew it pretty ...
2
votes
1answer
127 views

Storing different algorithms and using them for demonstration

I have an app for creating simple graphs (the kind with vertices and edges) and then using different algorithms on them (BFS, DFS, topsort, Prim's etc) for demonstrating how they work. I'm now ...
3
votes
1answer
1k views

Storing graphs with json and db

I have a Rails 4 app having to do with graphs. These graphs need to be stored and I'm not sure of the best way to do it. Firstly, the app has a SQLite db in development and PostgreSQL in production. I ...
35
votes
9answers
9k views

Developing on a production server

Today I got yelled at for developing an application on a production server. Quote, "developing on a production server is not acceptable - ever!" Here is the situation. I set up a development ...
6
votes
2answers
1k views

Is a data service API a good idea?

We currently have a monolithic Rails application that is really three separate applications that make use of the same data. In trying to figure out how to properly compartmentalize and break the mono-...
1
vote
3answers
286 views

Ruby/RoR development: desktop or server [closed]

Our company has started development of own systems "in-house". We already got couple of developers, who will be responsible for writing code in Ruby/RoR. We are currently discussing infrastructure, ...
5
votes
2answers
354 views

Could Ruby on Rails have been created in another language? [closed]

Could Ruby on Rails have been created in another language like PHP, or are there some functions in the Ruby language that make the difference?
7
votes
5answers
3k views

How to evaluate the quality of Rails code?

In a code review, what do you look for to assess a developer's expertise? Given an opportunity to look at a developer's work on a real-world project, what tell-tale signs are a tip-off to carelessness ...
7
votes
3answers
10k views

Is it okay to call a model method in my view?

In the interest of keeping my Controller's skinny, I put a headline method in a Model. # My Model class Property def headline "#{name} | #{address}" end end (Then, Property Controller for ...
3
votes
1answer
408 views

Rails + Heroku Architecture

I'm in the process of developing a Rails app that I plan on subsequently deploying to Heroku. I've never run apps on Heroku (outside of the free simple app) so I have some questions on a few things on ...
0
votes
2answers
233 views

Why there is much more support for closed xls format in rails (and ruby) than to an open ods format?

It is little depressive, but it seems to me that there is much more support for manipulating ugly proprietary closed format like xls in rails (and ruby) in general that to documented open Open ...
4
votes
2answers
2k views

Why is MongoDb popular with Node.js? [closed]

I've been looking att different web stacks, mainly rails and node.js. One thing that strikes me is that while rails is often used with a relational database Node.js seem to go hand in hand with ...
4
votes
1answer
262 views

Order collisions in ecommerce

Suppose I have a web app where sellers add their products and set them as available for sale. Then I show a list of products in my mobile app, where I get products via my REST API. My problem: suppose ...
1
vote
4answers
736 views

Randomness in Acceptance-Tests

I've got a simple authentication solution, where a user can log in with either email or username. Since I want to show the little feature in the acceptance tests but don't want to pollute them, I ...
2
votes
1answer
160 views

How do these technologies go together?

Ruby on Rails Twitter Bootstrap Html5Boilerplate Backbone.JS or Knockout.JS I sort of understand what each one is individually, but my understanding isn't strong enough to understand whether ...
39
votes
3answers
5k views

How to train junior programmers for today's (complicated) web environment?

Currently our company develops applications consisting, most of the time, in Ruby on Rails web servers and a bunch of different REST clients, from kiosk systems in Java to embedded devices in C/C++ (...
0
votes
1answer
200 views

What is a good design for a container, assignment and items

------------- 1 * -------------- * 1 -------- | Container |--------| Assignment |-----------| User | ------------- -------------- -------- ^ ...
11
votes
2answers
745 views

.Net developer trying to learn ruby on rails

I am a .NET developer and I just had the chance to play with Ruby on Rails this weekend. In .NET we separate layers of the application by creating separate class library projects. From the design ...
3
votes
4answers
248 views

What is the relationship between a framework like RoR and a database?

I'm a front end developer...I've never done ANY backend, although I did take a course in databases once. (I have a comp sci degree; I'm a competent programmer, I just haven't done any backend web ...
1
vote
3answers
1k views

Setting up a simple Ruby\Rails environment

I am coming from a .NET background and beginning my journey into the Mac OSX\Ruby\Rails environment. A lot of the resources I have found such as this one have between 5-10 steps for setting up a Ruby\...
2
votes
2answers
190 views

Which controller should I put for a search action that touches many different models?

I currently have the following models and am designing search functionality that searches within these 3 models: Locations Users User_friends Should I create a search controller or should I put the ...
3
votes
4answers
356 views

Senior team members want to move query-relevant persistent data from DB to cache. Does this make sense?

I am a young engineer recently employed at a small company that sells products to the general public. We use Ruby On Rails and MySQL. Our database has a lot of customer data, but a great deal more of "...
3
votes
2answers
154 views

Does this situation call for well specified associations, single table inheritance, or polymorphic association?

I'm building a web-app where users can keep track of who owes whom money. I have users and debts. Given a user I want to be able to find out all the debts to other users, and all the loans to other ...
4
votes
3answers
2k views

Why should we use externalized property files for an application?

I am currently working on a rails project and have a requirement where I want to be able to map a country name's initial letters to its ISD code. eg: IND => 91, USA => 1, etc. The broader question ...
25
votes
4answers
2k views

When creating an api should I stick with small functions and many calls, or a few calls and large functions?

I have a rails platform that I maintain. It has a lot of different web applications built on top of it. However now a client is asking for an API so that they can keep users on their site, but take ...
0
votes
2answers
669 views

How to improve database schema with different n:m and 1:n associations between users/tasks/comments/attachments

I'm trying to build a database for an upcoming Ruby on Rails webproject. There will be 4 tables minium: tasks, users, attachments and comments. And 1 table to join the n:m relations (tasks <-> ...
2
votes
1answer
939 views

Should one declare alternative response types (e.g. JSON) in Rails controller actions even if not utilising them?

Just wondering what the accepted convention is for Rails controller design. Currently, every controller in my app that I've written it set up to send a JSON response when necessary. Thing is, I only ...
34
votes
8answers
3k views

Ruby but not Rails on my Resume [closed]

I have listed Ruby as a skill on my resume becuase I've been programming in Ruby for 5 years while I work on my Ph.D. thesis. I've mostly been using it to implement natural language processing ...
1
vote
3answers
2k views

Rails generators for subscription and payment processing services?

I've been thinking about making a generator for managing subscriptions with options for a couple different payment processing services, it is something that I would use. Are there any existing ...
0
votes
1answer
239 views

Rails-API gem, Is there such thing as an API only application?

I've built a few API's using the complete rails stack. In each project there have been multiple uses for rails core features. Each of the API has had management screens for monitoring usage, managing ...
6
votes
1answer
3k views

Performing client-side OAuth authorized Twitter API calls versus server side, how much of a difference is there in terms of performance?

I'm working on a Twitter application in Ruby on Rails. One of the biggest arguments that I have with other people on the project is the method of calling the Twitter API. Before, everything was done ...
2
votes
1answer
795 views

How to keep background requests in sequence

I'm faced with implementing interfaces for some rather archaic systems, for handling online deposits to stored value accounts (think campus card accounts for students). Here's my dilemma: stage 1 of ...
-1
votes
2answers
132 views

Cache While Developing or Finish Development then Cache? [closed]

I'm new to cache and haven't used it on my projects. I would like to know about what is best practice in caching. Should caching be done while developing or finish development then cache everything?
6
votes
2answers
2k views

Are session aware Models a bad thing?

I'm thinking specifically in Rails here, but I suspect this is a wider question. In a Rails web application I'm using data from the session in models in order that the models know who is logged in. I ...
-1
votes
1answer
82 views

Verify uniqueness of new content

I'm working on a review site, where there is a minor issue with almost duplicate reviews across items. Just a few words are changed. It would be very nice to be able to uncover these duplicates before ...
11
votes
1answer
7k views

Is it bad form to change multiple tables in a single Rails migration file?

I wrote a migration file with the following code: class AddScheduleIdToPlayers < ActiveRecord::Migration def change add_column :players, :schedule_id, :integer add_column :...
0
votes
1answer
519 views

What is the pattern behind respond_to / respond_with in Rails?

Is there a specific name to this? For me it looks like a view router, or a presenter router (I would name it like that) but maybe there is a better name and explication.
3
votes
2answers
608 views

what receives an ajax call?

I'm making a site which should (a) take information from the user in the form of files and forms, (b) take that data to the server to be run on a C application, and (c) take the result back and show ...
1
vote
2answers
2k views

What is faster and preferable way for variable assignment in ruby? [closed]

I am a RoR developer and want to clarify some doubt about ruby variable assignment. In ruby we have two ways for variable assignment. str, arr, num = "Hi", [1, 2], 3 and str = "Hi" arr = [1, 2] ...
1
vote
0answers
80 views

reading parameters and files on browser, looking how to execute on server

I have a site done in Rails, which uses javascript to load files and generate forms for the user to input certain information. Those files and parameters are then to be used in a fortran code on the ...
4
votes
4answers
1k views

What technologies are needed to be a freelance web developer / designer targeting small businesses?

First off, I'm not looking for this answer: "learn PHP/MySQL, JQuery, HTML/CSS...." My background, I wear many hats, and do many things. Currently I manage investment accounts with a business partner ...