Fix user_avatar url
This commit is contained in:
parent
6cbf3df70e
commit
a97a64b6db
3 changed files with 3 additions and 3 deletions
|
@ -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'
|
||||
|
|
|
@ -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 -->
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue