ruby on rails - Page redirect after user logs in -
i'd able redirect user different home page after log in (this part working) still logged in user able access index feed if want. @ moment can see favourites_show_path not @guidelines = guideline.order(:title).all. there way (without having build sec index action , view) home page after login direct favourites_show_path still able see @guidelines = guideline.order(:title).all?
def index if params[:search].present? @search = sunspot.search(guideline) fulltext params[:search] end @guidelines = @search.results else redirect_to favourites_show_path, :action => 'index' , homecoming if current_user @guidelines = guideline.order(:title).all end
just move @guidelines...
out of status , rename search results' symbol:
def index @guidelines = guideline.order(:title).all if params[:search].present? @search = sunspot.search(guideline) fulltext params[:search] end @results = @search.results else redirect_to favourites_show_path, :action => 'index' , homecoming if current_user end end
ruby-on-rails ruby-on-rails-3
No comments:
Post a Comment