now with rails 3.1 doesn't all the java code go in a *.js.coffee file inside the app/assets/javascripts/ ? or do we write it on the corresponding view directly?
On Aug 10, 7:05 pm, 7stud -- <[email protected]> wrote: > Kleber Shimabuku wrote in post #1015905: > > > > > and the form > > > <p class="fields"> > > <%= f.collection_select(:part_id, @parts, :id, :title, { :prompt => > > true } , { :onchange => "load_part_price_select(this.id, > > this.options[this.selectedIndex].value);" } ) %> > > <%= f.label(:part_id, "Price: ") %> > > <span class="price"></span> > > <%= f.hidden_field :_destroy %> > > <%= link_to_remove_fields "remove", f %> > > </p> > > js shouldn't be in your html, i.e. this: > > { :onchange => "load_part_price_select(this.id, > > > this.options[this.selectedIndex].value);" > > should be done up in the <head> section of your html. In order to do > that, you have to put your js inside a function that executes after the > page has loaded. > > -- > Posted viahttp://www.ruby-forum.com/. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

