Ruby on Rails Friday, December 19, 2014

James Davis, PhD wrote in post #1164975:
> Can you show us the actual error from the console or logs? Also show us
> the code where you reference profiles_path and profile_path.
>
> Without seeing this code for context, try moving 'resources :profiles'
> to the top of the routes file as Rais uses the first matching route and
> you may have a conflict.

I destroyed the ProfilesController, so that I can try a new approach. I
found this solution below. Create a new UsersController with show
action. resources :users

class UsersController < ApplicationController
#before_filter :authenticate_user!

def show
@user = User.find(params[:id])

respond_to do |format|
format.html # show.html.erb
format.json { render :json => @user }
end
end
end

<li><%= link_to "Profile", current_user %></li>
<li><%= link_to "Settings", edit_user_registration_path %></li>
<li><%= link_to "Logout", destroy_user_session_path, method: "delete"
%></li>
If you have a better way of solving this problem. Please, let me know.
Devise comes with just about everything you might need, but adding user
profiles for public and private viewing is a different story.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/79f6ef5833bf58e4132ad0c572286fd6%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment