Monday, August 13, 2012

[Rails] How to define virtual attribute for date_select drop menu using active model

Hi All,

I am using active model for payment process in my application , i am not able to add field for date field, since it throws error as below undefined method `card_expiration_date(3i)='.

In model:
 
include ActiveModel::Validations
  include ActiveModel::Conversion
  extend ActiveModel::Naming

  attr_accessor: card_expiration_date

In view:

<%=f.date_select :card_expiration_date, :add_month_numbers => false,:discard_day => true, :start_year => (Date.today.year-10), :end_year => (Date.today.year+10),:order=>[ :month,:year] %>


Any help would be appreciated.

regards,
Loganathan
ViewMe

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate