User profile pages with devise - Routing to show action

后端 未结 3 1078
执笔经年
执笔经年 2020-12-31 21:33

Authentication with devise and a separate controller (Users) that is a single \'show\' action

class UsersController < ApplicationController
#before_filter         


        
3条回答
  •  粉色の甜心
    2020-12-31 21:59

    If you want to see the current logged in users profile make sure you are logged in.

    add the before_filter :authenticate_user! in users controller.

    Then in header link

  • <%= link_to "Profile", current_user %>
提交回复
热议问题