Tagged Questions
0
votes
0answers
42 views
New library for declaring units on numerical model attributes
A couple of days ago as I was working on a project I stumbled something I consider a problem and that, as far I know, doesn't have any good solution available in Rails.
The problem is attribute ...
4
votes
1answer
2k views
How to write html flash messages?
Flash messages are generally composed in the controller. Some times we need those flash messages to have links in them (like an undo button).
How would you go on to compose such a message?
The only ...
2
votes
2answers
86 views
Should view related methods be included in models?
class Submission < ActiveRecord::Base
def get_status_css()
if self.status == IN_PROGRESS
"info"
elsif self.status == FAILED
"error"
elsif self.status == COMPLETED
...
2
votes
1answer
533 views
Should I pass my params from controller to the model?
I have an index with a filter form that submits something like:
{
:only_locked => "yes",
:manufacturer_id => 45,
:order_by => "date",
:tags => ["some", "other"]
}
I want to ...