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.
3
votes
4answers
135 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
113 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 ...
0
votes
2answers
77 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 ...
0
votes
0answers
16 views
Reporting with authorization on Rails
I asked this on Stack Overflow and was told this is a better place to ask.
I am build a rails app that has the following models*:
User
-name,password etc.
-has_many :regions
-has_many :reports
...
3
votes
5answers
206 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
93 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
111 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 ...
0
votes
2answers
102 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 <-> ...
21
votes
4answers
910 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
1answer
73 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 ...
30
votes
9answers
3k 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 ...
3
votes
2answers
213 views
Could Ruby on Rails haven been create in another language?
Could Ruby on rails have been created in another language like PHP or is there some functions in the Ruby langauage that makes the differences?
2
votes
1answer
240 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
1answer
72 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 ...
0
votes
1answer
85 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 ...
2
votes
0answers
83 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 ...
2
votes
1answer
100 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
102 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?
...
3
votes
2answers
136 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 ...
0
votes
0answers
48 views
What set of tools make up “the rails way” of testing javascript in the browser?
What's the concensus for doing in-browser (either headless or remote-controlled) testing of javascript?
Unit testing my JS is nice, but can't protect against irresponsible changes to the DOM.
Unit ...
-2
votes
1answer
129 views
Where can I find out about basic python usage, cli, editor and testing? [closed]
I'm coming from Ruby / Ruby on Rails to Python.
Where can I find or find resources about:
The command prompt, what is python's version of 'irb'
info and recommendations on editors, plugins and IDE's
...
-1
votes
1answer
70 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 ...
0
votes
1answer
61 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.
0
votes
1answer
151 views
Rails vs. Drupal [closed]
I was querying indeed.com/salary to investigate general market trends. When comparing ruby on rails with drupal, you would observe a substantial difference between these two.
I'm not sure if the data ...
3
votes
2answers
151 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 ...
4
votes
4answers
524 views
Ruby on rails not popular in big international IT companies? [closed]
I would like to ask for advice more experienced ROR developers. I am new in programming and like the idea of ROR and I am before the decision on which programming language to specialize Java vs ROR.
...
0
votes
0answers
40 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 ...
2
votes
1answer
132 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 ...
5
votes
1answer
1k 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 ...
1
vote
2answers
160 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
1answer
220 views
Applying for job: how to showcase work done for (private) past clients?
I want to apply for my first "real" (read: non-freelance) Ruby on Rails job.
I've built several apps already. My best work (also the most logically complicated app) was for a freelance client, and ...
2
votes
2answers
238 views
Should I prefer instance methods over class methods in Ruby?
I'm working on a rails application, and I've been pulling functionality out of my rails code and into pure ruby classes in lib/. I've found myself often writing classes like this:
class ...
4
votes
3answers
136 views
How to architect this simple problem in high level
I need help with setting up the models(associations), on this problem.Write an application which displays these events in descending chronological order, For example, they can choose to see every ...
1
vote
2answers
586 views
Is it worth converting a Django project to Rails?
I have a project I shelved a while back- it was essentially a working web app built in django but I stopped working on it to work on something else.
I plan on starting it up again in my spare time, ...
0
votes
2answers
215 views
How do I read API documentation?
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
143 views
Ruby/RoR development: desktop or server
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 about ...
1
vote
2answers
176 views
Use a partial in a partial?
I'm a Rails newbie, so bear with me.
I have a few places, some pages, some partials that use:
<%= link_to "delete", post, method: :delete,
data: { confirm: "You ...
3
votes
5answers
1k views
easiest way for push notifications
I wanted to implement real time push notification to one of the apps written in RoR. I don't have any experience with nodejs, nowjs, express or socketio.
What would be the easiest way to implement ...
2
votes
6answers
880 views
How much Ruby should I learn before moving to Rails?
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 ...
0
votes
1answer
164 views
Convention on model names in ruby on rails
I was doing my ER diagram for a rails application I'm about to begin with and there I have an entity called Class News so I'd have a model ClassNew but I don't know if I will have problems in the ...
-2
votes
2answers
251 views
Am I shooting myself in the foot if I use Mercurial for Rails development?
I'm a Rails developer and I prefer Mercurial over Git. However, I know that the Rails community is very pro-Git. So my question is it possible that my choice of version control system would turn back ...
2
votes
3answers
1k views
Rails - Does using partials slow views rendering?
I'm having performance issues on a Rails 3.1.0 application, now I've done dome changes on my queries with AR and so but views still takes too many time to render, I've divided the views, loops and so, ...
2
votes
3answers
111 views
Post-hoc testing in TDD recommended?
I have a personal project that doesn't have robust testing. I had a bit of TDD going on at the beginning, but it quickly became counterproductive as the project details changed dramatically over time. ...
2
votes
1answer
348 views
Rails application - how to optimize/reduce database calls when iterating over a collection
What's the best way to optimize a Rails app where you need to pull info from the database for a collection of items?
For example, if I am building an online forum system... I would have a number of ...
0
votes
2answers
133 views
Structuring a rails application with static data
I'm working on a rails application, and so far I've focused on the api and the functionality. But now I'm more and more reaching a point where I will want to add static content, descriptions of the ...
1
vote
3answers
145 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 / ...
0
votes
1answer
118 views
In rails, what defines unit testing as opposed to other kinds of testing [closed]
Initially I thought this was simple: unit testing for models with other testing such as integration for controller and browser testing for views.
But more recently I've seen a lot of references to ...
-1
votes
1answer
62 views
What should one keep in mind when switching from traditional to RESTful routing in Rails?
What should one keep in mind when switching from traditional to RESTful routing in Rails?
From a typical Rails routes.rb file:
# This is a legacy wild controller route that's not recommended for ...
1
vote
1answer
290 views
rails fake data, considering switch from faker to forgery, any advantages or pitfalls?
With Ruby on Rails I've usually used Forgery for generating dummy data for testing.
I've noticed recently that several clients and tutorials are using Faker
They both seem fairly similar in use ...
0
votes
1answer
240 views
What is the canonical resource on multi-tenancy web applications using ruby + rails
What is the canonical resource on multi-tenancy web applications using ruby + rails. There are a number of ways to develop rails apps using cloud capabilities with real elastic properties but there ...