I deleted the Index.html in my /public/ folder. I added a "application" folder in my views. In it I put a new index.html.erb. This I want to be my startpage/homepage.
In my new "index.html.erb" I set:
link_to 'sign in', {:controller => 'devise/sessions', :action => 'new'}
But it redirects me to the "application#index".
I set root :to => "application#index
How开发者_如何学JAVA can I set this to route it to "posts#index" after I sign in, for example?
Is there a chance to use .erb oder .haml in my /public/index.html?
Many thanks!!
I'm not sure I completely understand your question, but it sounds like you want users to be directed to a page that is not the root after they log in. To do this you can implement the after_sign_in_path_for method in your application_controller as shown in the devise wiki.
def after_sign_in_path_for(resource_or_scope)
posts_index_path
end
精彩评论