I have a lot of actions that receives params via method arguments:
class App < E
map '/'
def read page
@page = page
# etc.
render
end
def profile user
@user = user
# etc.
render
end
end
How do i access page, user etc. in templates without assign them to instance variables?
You have at least 2 options here.
Most straightforward one is to use
action_params:Please note this works only with Ruby 1.9
In Ruby 1.8 use
action_params[0]Another way is to pass your params as context variables: