I have a variable in my Sinatra application:
get '/' do
@agenda_date = Date.today
@next_date_str = (Date.today + 1).to_s
@prev_date_str = 'date=' + (Date.today - 1).to_s
And I want use it as href attribute in my view:
%a{:id => 'prev_day', :href => @prev_date_str } Prev day
or
%a{:id => 'prev_day', :href => 'date=' + @next_date_str } Next day
How can I get it?
This should work
If that’s what you ask…
First line works as it is, so I’m not sure what issue do you have? Only thing missing in the handler is