Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to have authenticated user land on their profile page first instead of home#index - using Devise
    primarykey
    data
    text
    <p>My mind is moving slow...this is a simple problem...I know. Please forgive my noobness here...</p> <p>I want to direct an authenticated user to that users profile page. </p> <p>Note: I am using Devise.</p> <p>Note 2: you can see the entire routes.rb file here....pastie.org/6142383 </p> <p>When I do "rake routes" I get this as the route info....</p> <pre><code>profile GET /profiles/:id(.:format) profiles#show </code></pre> <p>So in my routes.rb file I've tried this...</p> <pre><code>authenticated :user do root :to =&gt; 'profiles#show' end </code></pre> <p>But I'm getting an error "app/controllers/profiles_controller.rb line 17" which is this...</p> <pre><code>@profile = Profile.find(params[:id]) </code></pre> <p>So I need to somehow indicate the params[:id] in my routes.rb but I'm confused as to how...</p> <pre><code>authenticated :user do root :to =&gt; '?' # how to land user on www.website.com/profile/1 end </code></pre> <p>Thank you for your time...</p> <p>UPDATE:</p> <p>I'm using the gem 'better errors' (find out about this gem here) <a href="http://selfless-singleton.rickwinfrey.com/2012/12/13/better-errors/" rel="nofollow">http://selfless-singleton.rickwinfrey.com/2012/12/13/better-errors/</a> the error reads....</p> <pre><code>ActiveRecord::RecordNotFound at / Couldn't find Profile without an ID ProfileControllers#show app/controllers/profiles_controller.rb, line 17 </code></pre> <p>and then shows me the exact line...</p> <pre><code>12 end 13 14 # GET /profiles/1 15 # GET /profiles/1.json 16 def show 17 @profile = Profile.find(params[:id]) 18 19 respond_to do |format| 20 format.html # show.html.erb 21 format.json { render json: @profile } 22 end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload