I have the following:
<% form_remote_for :role, :method => :put, :url => {:controller =>
"roles", :action => "update", :id => @role.id\
} do |f| %>
<tr>
<td><%= select("role", "default_view",
Account::ROLES) %></td>
<td><%= submit_tag("Update"); %> </td>
<td>
<div id="role_attributes">
</div>
</td>
</tr>
<% end -%>
Controller code:
def update
role = Role.find(params[:id])
role.update_attributes(params[:role])
render :update do |page|
logger.info "update: " + debug(params)
end
the "debug(params)" outputs:
update: <pre class=''debug_dump''>---
!map:HashWithIndifferentAccess
_method: put
action: update
id: "6"
controller: roles
</pre>
There is no "default_view" field from my drop down. Just the params
passed on the URL string. Not sure why this is happening.
Thanks for any help
--
Posted via http://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
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
-~----------~----~----~----~------~----~------~--~---
I solved it: Don''t put your form tag under a <table> tag. Argh. -- Posted via http://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 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 -~----------~----~----~----~------~----~------~--~---
2009/1/9 Allen Walker <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>> > I solved it: Don''t put your form tag under a <table> tag. Argh. >*Is this a Rails bug? * Just hit the same issue, i.e. my field attributes were not being passed within a "remote_form_for" that was within a table. How is one supposed to work around this if you need an AJAX form call within part of a table, and the table is required for the existing layout of the page? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
2009/2/19 Greg Hauptmann <greg.hauptmann.ruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> 2009/1/9 Allen Walker <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > >> >> I solved it: Don''t put your form tag under a <table> tag. Argh. >> >I see that you can put a form in a table, but it has to fit entirely within a table cell (not perfect answer, but better than not being able to use a table at all) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
No, it''s not a Rails bug - lrn2html. (ref: http://www.w3.org/TR/html401/struct/tables.html#h-11.2.1 ) Typically, one puts the table in the form, not the other way around. The HTML spec is pretty specific about what can go inside the table tag without being contained by a cell. I''d also add, in reference to the original code, that you should be using f.select(:default_view, Account::ROLES) - form_for and friends pass the builder to the block. --Matt Jones On Feb 19, 12:17 am, Greg Hauptmann <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 2009/2/19 Greg Hauptmann <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > 2009/1/9 Allen Walker <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > >> I solved it: Don''t put your form tag under a <table> tag. Argh. > > I see that you can put a form in a table, but it has to fit entirely within > a table cell (not perfect answer, but better than not being able to use a > table at all)--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
fair enough - interesting through things worked fine with "form_for", and it was just when moving to "remote_form_for" the issue kicked in... 2009/2/20 Matt Jones <al2o3cr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > No, it''s not a Rails bug - lrn2html. (ref: > http://www.w3.org/TR/html401/struct/tables.html#h-11.2.1 > ) > > Typically, one puts the table in the form, not the other way around. > The HTML spec is pretty specific about what can go inside the table > tag > without being contained by a cell. > > I''d also add, in reference to the original code, that you should be > using > f.select(:default_view, Account::ROLES) - form_for and friends pass > the > builder to the block. > > --Matt Jones > > On Feb 19, 12:17 am, Greg Hauptmann <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > 2009/2/19 Greg Hauptmann <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > 2009/1/9 Allen Walker <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > > > >> I solved it: Don''t put your form tag under a <table> tag. Argh. > > > > I see that you can put a form in a table, but it has to fit entirely > within > > a table cell (not perfect answer, but better than not being able to use > a > > table at all) > > >-- Greg http://blog.gregnet.org/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 20 Feb 2009, at 10:52, Greg Hauptmann wrote:> fair enough - interesting through things worked fine with > "form_for", and it was just when moving to "remote_form_for" the > issue kicked in... >Probably because with remote_form_for the serialization happens in javascript. You''re going down a different codepath and so the undefined behaviour may be different. Fred> 2009/2/20 Matt Jones <al2o3cr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > No, it''s not a Rails bug - lrn2html. (ref: http://www.w3.org/TR/html401/struct/tables.html#h-11.2.1 > ) > > Typically, one puts the table in the form, not the other way around. > The HTML spec is pretty specific about what can go inside the table > tag > without being contained by a cell. > > I''d also add, in reference to the original code, that you should be > using > f.select(:default_view, Account::ROLES) - form_for and friends pass > the > builder to the block. > > --Matt Jones > > On Feb 19, 12:17 am, Greg Hauptmann <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > 2009/2/19 Greg Hauptmann <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > 2009/1/9 Allen Walker <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > > > >> I solved it: Don''t put your form tag under a <table> tag. Argh. > > > > I see that you can put a form in a table, but it has to fit > entirely within > > a table cell (not perfect answer, but better than not being able > to use a > > table at all) > > > > > -- > Greg > http://blog.gregnet.org/ > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---