Fix user_avatar url

This commit is contained in:
benji 2015-03-21 13:00:24 +01:00
parent 6cbf3df70e
commit a97a64b6db
3 changed files with 3 additions and 3 deletions

View file

@ -7,6 +7,7 @@ class UserAvatarController < ApplicationController
def create
if @user.update_attributes(user_params)
flash[:success] = "Your profile is complete. You are now logged in."
reset_session
sign_in_and_redirect @user
else
render 'new'

View file

@ -1,7 +1,7 @@
<h2>Add avatar to <%= @user.uid %></h2>
<%= render 'flash' %>
<%= f_form_for @user, url: '/user_avatar', method: :post do |f| %>
<%= f_form_for @user, url: url_for(controller: 'user_avatar', action: 'create'), method: :post do |f| %>
<%= f.error_messages %>
<!-- To prevent an empty form submit from crashing -->

View file

@ -48,9 +48,8 @@ users = [
},
{
uid: 'benji',
avatar: File.new('public/seeds/users/benji.jpg', 'r'),
# avatar: File.new('public/seeds/users/benji.jpg', 'r'),
dagschotel: Product.first,
provider: 'zeuswpi'
},
{
uid: 'don',