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' 

see: http://www.sinatrarb.com/contrib/multi_route.html


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -