Simple view question

Hoiw do I display the following paramter in my view? Parameters:
{“id”=>“cars”}

David S. wrote:

Hoiw do I display the following paramter in my view? Parameters:
{“id”=>“cars”}

<%= params[:id] %>

On 11/3/06, David S. [email protected] wrote:

Hoiw do I display the following paramter in my view? Parameters:
{“id”=>“cars”}

I guess the MVC way is to populate a variable in your controller that is
then made available to your view. So for your example in your
controller

@some_id = params[:id]

and then in your view

<%= @some_id %>

Not knowing what your trying to achieve I don’t think I can give you
much
more than that.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs