Skip to content
Browse files

Fixed a lot of path errors. Added some styling to action links. Added…

… navigation links to account page to get started after login.
  • Loading branch information...
1 parent d4f889d commit 37e1e449a0f762afd32c542958be37dd6308bf4b @Soleone committed Mar 25, 2009
View
4 app/controllers/photos_controller.rb
@@ -48,7 +48,7 @@ def create
respond_to do |format|
if @photo.save
flash[:notice] = 'Photo was successfully created.'
- format.html { redirect_to(@photo) }
+ format.html { redirect_to @photo }
format.xml { render :xml => @photo, :status => :created, :location => @photo }
else
format.html { render :action => "new" }
@@ -65,7 +65,7 @@ def update
respond_to do |format|
if @photo.update_attributes(params[:photo])
flash[:notice] = 'Photo was successfully updated.'
- format.html { redirect_to [@user, @photo] }
+ format.html { redirect_to @photo }
format.xml { head :ok }
else
format.html { render :action => "edit" }
View
8 app/views/photos/edit.html.erb
@@ -1,10 +1,12 @@
<h1><%= t 'photo.edit' %></h1>
-<% form_for [@user, @photo], :html => { :multipart => true } do |f| %>
+<% form_for @photo, :html => { :multipart => true } do |f| %>
<%= render :partial => 'form', :object => f %>
<p><%= f.submit t('update') %></p>
<% end %>
-<%= link_to t('show'), [@user, @photo] %> |
-<%= link_to t('back'), user_photos_path(@user) %>
+<ul class="actions">
+ <li><%= link_to t('show'), @photo %></li>
+ <li><%= link_to t('back'), user_photos_path(@user) %></li>
+</ul>
View
5 app/views/photos/index.html.erb
@@ -7,5 +7,6 @@
<div class="spacer" />
</div>
-<br/>
-<%= link_to t('photo.upload'), new_user_photo_path(@user) %>
+<ul class="actions">
+ <li><%= link_to t('photo.upload'), new_user_photo_path(@user) %></li>
+</ul>
View
4 app/views/photos/new.html.erb
@@ -6,4 +6,6 @@
<p><%= f.submit t('create') %></p>
<% end %>
-<%= link_to t('back'), user_photos_path(@user) %>
+<ul class="actions">
+ <li><%= link_to t('back'), user_photos_path(@user) %></li>
+</ul>
View
6 app/views/photos/show.html.erb
@@ -6,5 +6,7 @@
<%=h @photo.description %>
</p>
-<%= link_to 'Edit', edit_user_photo_path(@user, @photo) %> |
-<%= link_to 'Back', user_photos_path(@user) %>
+<ul class="actions">
+ <li><%= link_to 'Edit', [:edit, @photo] %></li>
+ <li><%= link_to 'Back', user_photos_path(@user) %></li>
+</ul>
View
13 app/views/users/show.html.erb
@@ -1,3 +1,10 @@
-<%= render :partial => @user %>
-
-<%= link_to 'Edit', edit_account_path %>
+<ul class="actions">
+ <li><%= link_to 'Edit account information', edit_account_path %></li>
+</ul>
+
+<%= render :partial => @user %>
+
+<ul class="actions">
+ <li><%= link_to "Show your photos", user_photos_path(@user) %></li>
+ <li><%= link_to "Show all photos", :controller => "photos" %></li>
+</div>
View
21 public/stylesheets/application.css
@@ -25,4 +25,25 @@ div.float {
.spacer {
clear: both;
+}
+
+ul.actions {
+ list-style: none;
+ padding: 0;
+}
+
+.actions li {
+ display: inline;
+}
+
+.actions li:after {
+ content: " | ";
+}
+
+.actions li:last-child:after {
+ content: "";
+}
+
+.actions a {
+ color: #c00;
}

0 comments on commit 37e1e44

Please sign in to comment.
Something went wrong with that request. Please try again.