Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a project page for created projects and added a basic mechanism t…

…o stop users viewing projects they don't own.
  • Loading branch information...
commit 71a2104ea0f21329ba124dbfb3f00a36457bc37d 1 parent 54b4912
@leenookx authored
View
15 app/controllers/projects_controller.rb
@@ -94,12 +94,15 @@ def show
format.json { render :json => { :status => :error, :message => 'Invalid authentication code.'}.to_json, :status => 403 }
end
else
- projects = Project.find_all_by_owner( user.id )
- if projects
- respond_to do |format|
- format.html
- format.xml { render :xml => link.errors, :status => :unprocessable_entity }
- format.json { render :json => link.errors, :status => :unprocessable_entity }
+ @project = Project.find( session[:id] )
+ if @project
+ if @project.owner = @user.id
+ respond_to do |format|
+ format.html
+ format.xml { render :xml => link.errors, :status => :unprocessable_entity }
+ format.json { render :json => link.errors, :status => :unprocessable_entity }
+ end
+ else
end
end
end
View
7 app/views/projects/show.html.erb
@@ -1,3 +1,6 @@
+<h2><%= @project.name %></h2>
+<%= @project.description %>
-<%= link_to 'Edit', edit_project_path(@project) %> |
-<%= link_to 'Back', projects_path %>
+<br />
+
+<%= link_to 'Back', projects_path %>
Please sign in to comment.
Something went wrong with that request. Please try again.