ruby on rails - Pass data between two controllers but not via url as params -


below code

<% if @user.empty? == true %>   <p> sorry no data display</p> <%else%>   <% @user.each |n|%>    user id = <%=n.id%> <br \>    user type = <%=n.type%> <br \>    user name = <%= n.name%> <br \>    <%= link_to "good. can proceed on creating new", new_user_product_path(current_user)%>  <%end%> <%end%> 

this code under searches#index. can see, after set of results shown, want user able create new product. when creating product, want make sure <%= n.name%> pass on new_user_product_path(current_user) (its form). not via url.

the form field want populate is

<%= f.hidden_field :user_name%> 

so, how do it?

thanks

i think found solution

i made <%=n.name%> <% $name = n.name %> , since global variable, accessible now.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -