Created
December 14, 2012 20:29
-
-
Save KennyVB/4288411 to your computer and use it in GitHub Desktop.
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
<h1>N3rd</h1> | |
<table> | |
<% @n3rds.each do |n3rd| %> | |
<tr> | |
<td><%= image_tag(n3rd.image_url, class: 'list_image') %></td> | |
<td><%= link_to n3rd.title, n3rd_with_title_path(n3rd, :title => n3rd.title)%></td> | |
<% if can? :update, n3rd %> | |
<td><%= link_to 'Edit', edit_n3rd_path(n3rd) %></td> | |
<% end %> | |
<% if can? :destroy, n3rd %> | |
<td><%= link_to 'Destroy', n3rd, method: :delete, data: { confirm: 'Are you sure?' } %></td> | |
<% end %> | |
</tr> | |
<% end %> | |
</table> | |
<br /> | |
<%= link_to 'New N3rd', new_n3rd_path %> |
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
Blog4::Application.routes.draw do | |
resources :abouts | |
match '/posts/:id/:title' => 'posts#show', :as => :post_with_title | |
match '/n3rds/:id/:title' => 'n3rds#show', :as => :n3rd_with_title | |
resources :n3rds | |
resources :posts do | |
resources :comments | |
end | |
get "home/index" | |
resources :users, :user_sessions | |
match 'login' => 'user_sessions#new', :as => :login | |
match 'logout' => 'user_sessions#destroy', :as => :logout | |
root :to => 'home#index' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment