ruby on rails - Setting root route in Sinatra -
i want able set root route particular index action. below have:
get '/' redirect '/pokemons' end '/pokemons' @pokemons = pokemon.all erb :"pokemons/index" end
it feels hacky though. wondering if there rails equivalency of `root to: 'some_controller#some_action' in sinatra.
using sinatra::multiroute (from sinatra-contrib gem), specify both routes on 1 get:
get '/', '/pokemons'
Comments
Post a Comment