Form problem

Hi all,

I have a form:
<%= form_tag ‘/admin/update_node’ %>
<%= hidden_field_tag(‘id’, showtree.id) %>
<%= text_field(‘name’, showtree.name, {:size => 20, :value =>
showtree.name}) %>
<%= submit_tag(‘Save’) %>
<% end_form_tag %>

rendered in html

and the controller function
def update_node
Node.update(params[:id], {:name => params[:name]})
redirect_to(:action => index)
end

When I save, the record (name) gets returned with a lot of garbage
(lines and newlines).

Can someone tell me what I’m doing wrong?

Thanks in advance
Stijn

When I save, the record (name) gets ???returned??? with a lot of
garbage

Your description is not precise… unable to comply :frowning:

2007/1/25, Tarscher [email protected]:

Tarscher wrote:

rendered in html
redirect_to(:action => index)
end

When I save, the record (name) gets returned with a lot of garbage
(lines and newlines).

params[:name] will be a Hash rather than a String because the
name property of the text field is “name[SelfMate II]”.

You probably want to use the text_field_tag helper rather
than the text_field helper.


We develop, watch us RoR, in numbers too big to ignore.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs