Found the way to do that by using 'inverse_of' option (see below):
On 25 Mar 2013, at 16:03, Javix wrote:
> I'm using accepts_nested_attributes as follows:
>
> class Timesheet < ActiveRecord::Base
> attr_accessible :status, :user_id, :start_date, :end_date,
> :activities_attributes
> has_m
I'm using accepts_nested_attributes as follows:
class Timesheet < ActiveRecord::Base
attr_accessible :status, :user_id, :start_date, :end_date,
:activities_attributes
has_many :activities, dependent: :destroy
has_many :time_entries, through: :activities
accepts_nested_attributes_for :acti
Hi everyone,
I just need a quick help :)
What is the best way to write some code in :presence option?
I have a Question model and one of the fields is question_type:
- example question
- static question
Each question has alternatives, and each of them has scores
What I want is to validate th
Here is the validation being used which is not working..
validates_presence_of :name => :controller_name, :if => :redirect?,
:message => "must have the same name as the controller."
The model has a string field for name.
The model has a boolean field for redirect.
The model has a string field for
4 matches
Mail list logo