On 14 August 2012 08:44, Loganathan Sellapa <loganathan...@gmail.com> wrote: > I thought it would create getter and setter methods for > "card_expiration_date" and the active model library would do the rest(such > as creating virtual attributes > card_expiration_date(1i),card_expiration_date(2li),card_expiration_date(3li) > for date time attribute(card_expiration_date), let me know if I am wrong.
Please don't top post, it makes it difficult to follow the thread. Insert your reply inline in the previous message. Thanks. You don't need to specify att_accessor for fields in the database, ActiveRecord will supply them automatically. By providing them yourself you have disabled the automatic ones. I guess you are a beginner with Rails so I suggest that you work through some tutorials to understand the basics. railstutorial.org is good and is free to use online. Colin > > regards, > Loganathan > ViewMe > > > > > > On Tue, Aug 14, 2012 at 1:06 PM, Colin Law <clan...@googlemail.com> wrote: >> >> On 14 August 2012 07:50, Loganathan Sellapa <loganathan...@gmail.com> >> wrote: >> > 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 >> >> What is the purpose of the line above? Check the docs for >> attr_accessor to see what it does. >> >> Colin >> >> > >> > 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] %> >> > >> >> -- >> 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+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.