On 7 July 2010 17:21, sigma <christoph.thom...@gmail.com> wrote:
> Hi there
>
> Is it possible to pass a parameter automatically to every rails
> generated link?
>
> for example:
>
> I have the parameter site_id which is passed via url
> (www.example.com/:site_id/:controller/:action/:id)
>
> is it possible to automatically pass the :site_id to all links/paths
> like f.i. "articles_path", "article_path(@article)" or is the only way
> to do this by passing the parameter in addition:
> "articles_path(:site_id=>params[:site_id])" or
> "article_path(@article, :site_id=>params[:site_id])".

I don't know the answer but if you are simply passing it backwards and
forwards in order to persist it then you might be better off using the
session. (session[:site_id] = ...)

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to