I have a partial called _profile.html:
Name
<%= f.text_field :name %>
Email
<%= f.text_field :email %>
.....
edit.rhtml is using the partial as follows:
Edit Your Billing Profile
<%= error_messages_for :billing_profile %> <% form_for :billing_profile, @bp, :url => billing_profile_path(@billing_profile), :html => { :method => :put } do |f| %><%= render :partial => “profile”, :locals => { :f => f } %>
<%= submit_tag "Update" %>
<% end %><%= link_to ‘Show’, billing_profile_path(@bp) %> |
<%= link_to ‘Back’, billing_profiles_path %>
and new.rhtml is using it as follows:
New billing_profile
<%= error_messages_for :billing_profile %>
<% form_for(:billing_profile, :url => billing_profiles_path) do |f| %>
<%= render :partial => “profile”, :locals => { :f => f } %>
<%= submit_tag "Create" %>
<% end %><%= link_to ‘Back’, billing_profiles_path %>
My question is how do I use partials for show.rhtml? I used the
scaffold generator of Rails 1.2 and it looks like:
Email: <%=h @billing_profile.email %>
Business phone: <%=h @billing_profile.business_phone %>
...... <%= link_to 'Edit', edit_billing_profile_path(@billing_profile) %> | <%= link_to 'Back', billing_profiles_path %>I tried several things but it breaks the functional tests. TIA.