Forum: Ruby on Rails passing a value in a hidden field inside a form

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-06-04 15:48
(Received via mailing list)
should be trivial but I can't figure this out from api

<%= hidden_field 'certifications', 'personnel_id', {value =
#{@personnel.id}} %>

I want to pass the value of 'id' field in my form to the certifications
controller as personnel_id

Craig
55428cbf149e35dd4b65f1d019d04139?d=identicon&s=25 Matthew Palmer (Guest)
on 2006-06-04 16:03
(Received via mailing list)
On Sun, Jun 04, 2006 at 06:46:09AM -0700, Craig White wrote:
> should be trivial but I can't figure this out from api
>
> <%= hidden_field 'certifications', 'personnel_id', {value =
> #{@personnel.id}} %>

Not sure whether hidden_field is supposed to work like that, but your
syntax
is *way* off.  Try this instead:

<%= hidden_field 'certifications', 'personnel_id', :value =>
@personnel.id
%>

- Matt

--
When I was a kid I used to pray every night for a new bicycle. Then I
realised that the Lord doesn't work that way so I stole one and asked
Him to
forgive me.
		-- Emo Philips.
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-06-04 20:26
(Received via mailing list)
On Sun, 2006-06-04 at 23:56 +1000, Matthew Palmer wrote:
> %>
----
perfect - thanks - I tried to get too complicated

Craig
This topic is locked and can not be replied to.