Skip to content
Browse files

resolved conflicts

  • Loading branch information...
2 parents d2b4b15 + 67c5615 commit 5b89fd315a0bbef9cf7cb12c26b24b9c607dc2ed John Rees committed Apr 5, 2012
View
5 Gemfile.lock
@@ -83,10 +83,15 @@ GEM
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
+ mime-types (1.17.2)
mime-types (1.18)
mini_magick (3.4)
subexec (~> 0.2.1)
+ mini_magick (3.4)
+ subexec (~> 0.2.1)
+ multi_json (1.1.0)
multi_json (1.2.0)
+ nokogiri (1.5.0)
nokogiri (1.5.2)
pg (0.13.2)
polyglot (0.3.3)
View
5 app/controllers/admin/base_controller.rb
@@ -6,11 +6,6 @@ class Admin::BaseController < ApplicationController
private
- def current_user
- @current_user ||= User.find(session[:user_id]) if session[:user_id]
- end
- helper_method :current_user
-
def authorize
redirect_to login_url, alert: "Not authorized" if current_user.nil?
end
View
8 app/controllers/application_controller.rb
@@ -1,3 +1,11 @@
class ApplicationController < ActionController::Base
protect_from_forgery
+
+ private
+
+ def current_user
+ @current_user ||= User.find(session[:user_id]) if session[:user_id]
+ end
+ helper_method :current_user
+
end
View
1 app/controllers/projects_controller.rb
@@ -20,5 +20,4 @@ def show
format.json { render json: @project }
end
end
-
end
View
6 app/views/projects/edit.html.erb
@@ -1,6 +0,0 @@
-<h1>Editing project</h1>
-
-<%= render 'form' %>
-
-<%= link_to 'Show', @project %> |
-<%= link_to 'Back', projects_path %>
View
4 app/views/projects/index.html.erb
@@ -5,8 +5,8 @@
</div>
<h3><%= link_to project.name, project %></h3>
- <span><%= link_to 'Edit', edit_project_path(project) %></span>
- <span><%= link_to 'Destroy', project, confirm: 'Are you sure?', method: :delete %></span>
+ <span><%= link_to('Edit', edit_admin_project_path(project)) if current_user %></span>
+ <span><%#= link_to('Destroy', project, confirm: 'Are you sure?', method: :delete) if current_user %></span>
<span><%= project.who %></span>
<span><%= project.where %></span>
View
5 app/views/projects/new.html.erb
@@ -1,5 +0,0 @@
-<h1>New project</h1>
-
-<%= render 'form' %>
-
-<%= link_to 'Back', projects_path %>
View
1 config/routes.rb
@@ -1,5 +1,4 @@
Urbanlites::Application.routes.draw do
-
resources :sessions
resources :users

0 comments on commit 5b89fd3

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