erez.bens-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Jul-23 09:53 UTC
DangerousAttributeError
I upgraded to rails 2.0.2 so i get this error ActiveRecord::DangerousAttributeError in Asset#show this is in the view <div class="price"><%=h shekels_to_dollars(@asset.price_shekel, options = {:precision => 0}) %></div> when i delete this line every thing is ok This is in application helper #Converts a shekels amount to a dollar amount and outputs as a currency. def shekels_to_dollars (amount_in_shekels, options = {}) @dollar = Rate.find(1).rate if amount_in_shekels amount_in_dollars = amount_in_shekels.to_f / @dollar.to_f return number_to_currency(amount_in_dollars, options) end end this is the db table class CreateRates < ActiveRecord::Migration def self.up create_table :rates do |t| t.column :name, :string t.column :rate, :float, :default => 0 t.column :update, :date t.column :updated_at, :datetime end end def self.down drop_table :rates end end Please help --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
erez.bens-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Jul-30 19:49 UTC
Re: DangerousAttributeError
Thanks Thorsten On 23 יולי, 11:58, Thorsten Müller <thors...@80beans.com> wrote:> Raised when attribute has a name reserved by Active Record (when > attribute has name of one of Active Record instance methods). > > In your case that''s most likely the "update" attribute, since it would > overwrite ActiveRecords update method--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---