Quantcast
Channel: Passing parameters to erb view - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Passing parameters to erb view

$
0
0

I'm trying to pass parameters to an erb view using Ruby and Sinatra.

For example, I can do:

get '/hello/:name' do"Hello #{params[:name]}!"end

How do I pass :name to the view?

get '/hello/:name' do  erb :helloend

And how do I read the parameters inside view/hello.erb?

Thanks!


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images