-1

I have one select tag inside form:

<%= form.fields_for :bill_address do |bill_form| %>
  <%= bill_form.select :id,  [Address.where(:user_id => current_user.id).collect{|b| "#{b.firstname} #{b.lastname}: #{b.address1}, #{b.state}"}, link_to "New Address"  ] %>
<% end %>

and one render partial which should go in second option in select menu(where is link_to)

 <%= render :partial => 'address/form', :locals => { :form => bill_form, :address_type => 'billing', :address => @order.bill_address } %>

Is it posibble to somehow render this partial inside link_to tag?

synopsa
  • 75
  • 1
  • 8

1 Answers1

0

link_to can take a block

<%= link_to root_path do %>
  <p><%= render ... %></p>
<% end %>
Eyeslandic
  • 14,553
  • 13
  • 41
  • 54