Hi folks
Im trying to pass a value to my hidden div using simple_form but im
not sure how to do this, was wondering if anyone could help me with
this. Here is my view using simple_form

<%= f.label "First name" %>
<%= f.text_field :first_name %>

<%= f.label "Last name" %>

<%= f.text_field :last_name %>

<%= f.input :full_name, :as => :hidden, :input_html => { :value =>
[:first_name, :last_name].join(' ') } %>

<%= f.submit %>

If ive already got the first and last name from the input fields how can
i pass those values to the hidden div? This code above isnt working.
Thanks

--
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@googlegroups.com.
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.

Search Discussions

  • Linus Pettersson at Jan 6, 2012 at 5:07 pm
    You have to use Javascript for that.

    Why do you want to do this anyway? If you just want to combine "First" and
    "Last" to one string "First Last", do it when you receive the data in the
    controller or model.

    Regards
    Linus

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/K_-ZBmpI9x4J.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 6, '12 at 4:59p
activeJan 6, '12 at 5:07p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Brent brent: 1 post Linus Pettersson: 1 post

People

Translate

site design / logo © 2021 Grokbase