Created
July 12, 2011 16:25
-
-
Save juliend2/1078347 to your computer and use it in GitHub Desktop.
Sinatra CRUD views
This file contains hidden or 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
-# new.haml: | |
- form_for @acclaim, '/admin/acclaims/new', :multipart=>true, :method=>'post' do |f| | |
= f.error_messages | |
= f.crud_fields | |
%p.buttons | |
= f.submit "Create",:class=>'wymupdate' | |
= link_to 'Back', '/admin/acclaims' | |
-# index.haml: | |
%h1 Index of Reviews | |
%p= link_to "New Review", '/admin/acclaims/new' | |
%table#orderable{:"data-ajaxurl"=>"/admin/acclaims/reorder"} | |
%tr | |
%th French Title | |
%th{:colspan=>2} | |
- @acclaims.each do |acclaim| | |
%tr{:id=>acclaim.id} | |
%td= acclaim.title_fr | |
%td= link_to "Edit", "/admin/acclaims/edit/#{acclaim.id}" | |
%td= delete_button("/admin/acclaims/delete/#{acclaim.id}") | |
-# edit.haml: | |
- form_for @acclaim, "/admin/acclaims/edit/#{@acclaim.id}", :multipart=>true, :method=>'put' do |f| | |
= f.error_messages | |
= f.crud_fields | |
%p.buttons | |
= f.submit "Update",:class=>'wymupdate' | |
= link_to 'Back', '/admin/acclaims' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment