ruby on rails - Use devise to route to specific url -
when user not signed in visits homepage gets redirected users/sign_in
which has sign in form. when user signs in gets redirected root of page. http://localhost:3000/#/_=_
but want user redirected url http://localhost:3000/#/home
i've found this on devise page.
def after_sign_in_path_for(resource) current_user_path end
but i'm not sure how should change code devise redirect users http://localhost:3000/#/home
corrosponds router-ui state.
.state('home', { url: '/home', templateurl: '../assets/angular-app/templates/_home.html.haml', controller: 'mainctrl', resolve: { postpromise: ['posts', function(posts){ return posts.getall(); }] } })
try in application controller
def after_sign_in_path_for(resource) "your_path_here" end
for example if want go root_path "your_path_here" = root_path
Comments
Post a Comment