On 16 August 2012 09:22, Paolo Bol
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:> Hi, i''m newbie with rails
>
> i''m try to pass the value of a text_field to the controller
without a
> submit all form.
>
> this is the html.erb code
>
> <td>
> <% j = rel_issue.journals.find(:last, !:notes.nil?)
> unless j.nil?
> if j.notes.nil? %>
>
> <p><%= text_field :testo,relation.id.to_s
%></p>
>
> <% else %>
>
>
<p><%=text_field:testo,relation.id.to_s,value=>j.notes%></p>
>
>
> <%end
> end%>
>
> </td>
>
> <td class="buttons">
>
> <%if rel_issue.status && !rel_issue.status.is_closed?%>
>
> <%= link_to_remote(image_tag(''link_break.png''),
> {:url => {:controller =>
''deda_roadmap'', :action => ''evade'',
> :id => rel_issue.id, :project => @project}},
> :submit => ''testo_''+relation.id.to_s,
:method =>
> :post,:title => l(:label_evasion)) %>
>
> <% end %>
> </td>
>
>
>
>
>
> and this the controller code:
>
> def evade
> issue= Issue.find_by_id(params[:id])
> parametro = "testo_"+issue.id.to_s
> testo_nota = params[parametro]
> if !testo_nota.nil?
> ecc....
>
>
> testo_nota is nil in controller and i don''t know why.
Have a look at the Rails Guide on debugging, it will show you
techniques that you can use to debug the code and work out where it is
going wrong.
Colin
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.