Skip to content

Commit

Permalink
disallow editing scores, remove bad route for Profile
Browse files Browse the repository at this point in the history
  • Loading branch information
talklittle committed Nov 18, 2010
1 parent 684cae7 commit 6ac1373
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
3 changes: 3 additions & 0 deletions app/controllers/users_controller.rb
Expand Up @@ -40,6 +40,9 @@ def edit
# POST /users
# POST /users.xml
def create
params[:user][:tester_score] = 0
params[:user][:evaluator_score] = 0
params[:user][:requester_score] = 0
@user = User.new(params[:user])

if @user.save
Expand Down
10 changes: 7 additions & 3 deletions app/views/layouts/_header.html.erb
Expand Up @@ -3,11 +3,15 @@
<ul class="navigation round">
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Tasks", tasks_path %></li>
<li><%= link_to "Profile", profile_path %></li>
<% if signed_in? %>
<li><%= link_to "Logout", logout_path, :method => :delete %></li>
<li><%= link_to "Profile", edit_user_path(current_user) %></li>
<% end %>
<li><%= link_to "About", about_path %></li>
<li><%= link_to "Contact Us", contact_path %></li>
<% if signed_in? %>
<li><%= link_to "Logout", logout_path, :method => :delete %></li>
<% else %>
<li><%= link_to "Login", login_path %></li>
<li><%= link_to "Login", login_path %></li>
<% end %>
</ul>
</div>
Expand Down
16 changes: 10 additions & 6 deletions app/views/users/edit.html.erb
Expand Up @@ -11,18 +11,22 @@
<%= f.label :password %><br />
<%= f.text_field :password %>
</p>

<p>
<%= f.label :tester_score %><br />
<%= f.text_field :tester_score %>
<b>Tester score:</b><br />
<%= @user.tester_score %>
</p>

<p>
<%= f.label :evaluator_score %><br />
<%= f.text_field :evaluator_score %>
<b>Evaluator score:</b><br />
<%= @user.evaluator_score %>
</p>

<p>
<%= f.label :requester_score %><br />
<%= f.text_field :requester_score %>
<b>Requester score:</b><br />
<%= @user.requester_score %>
</p>

<p>
<%= f.submit 'Update' %>
</p>
Expand Down
12 changes: 0 additions & 12 deletions app/views/users/new.html.erb
Expand Up @@ -11,18 +11,6 @@
<%= f.label :password %><br />
<%= f.password_field :password %>
</p>
<p>
<%= f.label :tester_score %><br />
<%= f.text_field :tester_score %>
</p>
<p>
<%= f.label :evaluator_score %><br />
<%= f.text_field :evaluator_score %>
</p>
<p>
<%= f.label :requester_score %><br />
<%= f.text_field :requester_score %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Expand Up @@ -40,7 +40,6 @@
# admin.resources :products
# end
map.register '/register', :controller => 'users', :action => 'new'
map.profile '/profile', :controller => 'users', :action => 'edit'
map.tasks '/tasks', :controller => 'tasks', :action => 'index'
map.about '/about', :controller => 'pages', :action => 'about'
map.contact '/contact', :controller => 'pages', :action => 'contact'
Expand Down

0 comments on commit 6ac1373

Please sign in to comment.