Created
June 7, 2010 22:47
-
-
Save zenom/429301 to your computer and use it in GitHub Desktop.
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
<div class="group"> | |
<%= f.label :name %><%= f.error_message_on :name %> | |
<%= f.text_field :name, :class => :text_field %> | |
<span class="description">Ex: a simple text</span> | |
</div> | |
<div class="group"> | |
<%= f.label :url %><%= f.error_message_on :url %> | |
<%= f.text_field :url, :class => :text_field %> | |
<span class="description">Ex: a simple text</span> | |
</div> | |
<div class="group"> | |
<% fields_for @sponsor.sites do |site| %> | |
<%= site.label :name %><%= site.error_message_on :name %> | |
<%= site.text_field :name %> | |
<%= site.text_field :url %> | |
<% end %> | |
</div> | |
<div class="group navform wat-cf"> | |
<%= f.submit pat(:save), :class => :button %> | |
<%= f.submit pat(:cancel), :onclick => "window.location='#{url(:sponsors, :index)}';return false", :class => :button %> | |
</div> |
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
put :update, :with => :id do | |
@sponsor = Sponsor.find(params[:id]) | |
if @sponsor.update_attributes(params[:sponsor]) | |
flash[:notice] = 'Sponsor was successfully updated.' | |
redirect url(:sponsors, :edit, :id => @sponsor.id) | |
else | |
render 'sponsors/edit' | |
end | |
end |
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 class="form" method="post" action="/admin/sponsors/update/4c0c3c6dd478e11b63000003"><input type="hidden" value="put" name="_method" /> | |
<div class="group"> | |
<label for="sponsor_name">Name: </label> | |
<input type="text" value="test" class="text_field" name="sponsor[name]" id="sponsor_name" /> | |
<span class="description">Ex: a simple text</span> | |
</div> | |
<div class="group"> | |
<label for="sponsor_url">Url: </label> | |
<input type="text" value="test" class="text_field" name="sponsor[url]" id="sponsor_url" /> | |
<span class="description">Ex: a simple text</span> | |
</div> | |
<div class="group"> | |
<label for="array_name">Name: </label> | |
<input type="text" value="" name="array[name]" id="array_name" /> | |
<input type="text" value="" name="array[url]" id="array_url" /> | |
</div> | |
<div class="group navform wat-cf"> | |
<input type="submit" value="Save" class="button" /> | |
<input type="submit" value="Cancel" class="button" onclick="window.location='/admin/sponsors';return false" /> | |
</div> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment