rails 3 style blocks

This commit is contained in:
Espen Antonsen 2011-04-25 13:50:07 +08:00
parent 1f5c13fca3
commit 316d7f974e
4 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
<% content_for :javascript do %> <%= content_for :javascript do %>
<%= javascript_include_tag "tag/tag" -%> <%= javascript_include_tag "tag/tag" -%>
<% end %> <% end %>
<%= hidden_field_tag :all_tags, @tags %> <%= hidden_field_tag :all_tags, @tags %>

View file

@ -10,7 +10,7 @@
<%= f.submit "Update" %> <%= f.submit "Update" %>
<% end %> <% end %>
<% content_for :action_links do %> <%= content_for :action_links do %>
<%= link_to("Delete photo", { :action => "destroy", :id => @photo, :collection_id => params[:collection_id] }, <%= link_to("Delete photo", { :action => "destroy", :id => @photo, :collection_id => params[:collection_id] },
:confirm => "Are you sure you want to delete this photo?", :confirm => "Are you sure you want to delete this photo?",
:method => :delete) %> :method => :delete) %>

View file

@ -1,6 +1,6 @@
<ul><%= render :partial => 'photos/thumb',:collection => @photos, :as => :photo %></ul> <ul><%= render :partial => 'photos/thumb',:collection => @photos, :as => :photo %></ul>
<% content_for :action_links do %> <%= content_for :action_links do %>
<%= link_to "Show albums containing photos tagged with #{params[:q]}", albums_path(:q => params[:q]) if params[:q] %> <%= link_to "Show albums containing photos tagged with #{params[:q]}", albums_path(:q => params[:q]) if params[:q] %>
<%= link_to "Show all photos tagged with #{params[:tag_id]}", tag_photos_path(params[:tag_id]) if params[:tag_id] && params[:album_id] %> <%= link_to "Show all photos tagged with #{params[:tag_id]}", tag_photos_path(params[:tag_id]) if params[:tag_id] && params[:album_id] %>
<% end %> <% end %>

View file

@ -23,7 +23,7 @@
<%= link_to tag, tag_photos_path(tag) %> <%= link_to tag, tag_photos_path(tag) %>
<% end %> <% end %>
<% content_for :action_links do %> <%= content_for :action_links do %>
<% if has_role?("admin") %> <% if has_role?("admin") %>
<% if params[:collection_id] %> <% if params[:collection_id] %>
<%= link_to "Edit photo", edit_collection_album_photo_path(params[:collection_id], params[:album_id], @photo) %> <%= link_to "Edit photo", edit_collection_album_photo_path(params[:collection_id], params[:album_id], @photo) %>