Created
March 30, 2011 21:45
-
-
Save meltzerj/895380 to your computer and use it in GitHub Desktop.
Edit view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for(:profile, @profile, :url => {:controller => "profiles", :action => "update"}, :html => { :multipart => true, :method => :put }) do |f| %> | |
<% if @user.errors.any? %> | |
<div id="errorExplanation"> | |
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2> | |
<ul> | |
<% @user.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<%= f.fields_for :user do |t| %> | |
<div class="field"> | |
<%= t.label :name, "Full Name" %><br /> | |
<%= t.text_field :name %> | |
</div> | |
<% end %> | |
<div class="field"> | |
<%= f.label :bio, "Biography" %><br /> | |
<%= f.text_area :bio %> | |
</div> | |
<%= f.fields_for :genre do |g| %> | |
<div class="field"> | |
<%= g.label :name, "Genres" %><br /> | |
<%= g.text_field :name, :id => 'genre_field' %> | |
</div> | |
<% end %> | |
<div class="field"> | |
<%= f.label :photo, "Upload Profile Picture" %> | |
<%= f.file_field :photo %><br /> | |
</div> | |
<div class="action"> | |
<%= f.submit :profile, :value => "Update Profile" %> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment