Padrino Select from Collection


/ Published in: Rails
Save to your folder(s)



Copy this code and paste it in your HTML
  1. get :new do
  2. @clients = Client.all
  3. @software = SiteSoftware.all
  4. @site = Site.new
  5. render 'sites/new'
  6.  
  7. end
  8.  
  9.  
  10. <div class="group">
  11. <%= f.label :client_id %><%= f.error_message_on :client_id %><br /><br />
  12. <%= f.select(:client_id, :collection => @clients, :fields => [:name, :id])%>
  13. <span class="description">Pick the Site Client</span>
  14. </div>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.