Value pass from controller to view

i have one controller
class UsersController < ApplicationController

  • def home*
  • @business_name = return_value[“business”]*
  • puts “business_name…#{@business_name}” *
  • end*
    end

and in home folder i have one view branch.html.erb…My problem is,
when i display this <%=@business_name %> in branch.html.erb, i didn’t
get
anything…
What is the issue in this view…?

Thank you
vishnu

On 17 April 2012 15:06, amvis [email protected] wrote:

display this <%=@business_name %>in branch.html.erb, i didn’t get
anything…
What is the issue in this view…?

Does the puts command show a name?

Change the display line to something like
<%= “Name = #{@business_name}” %>
which will let you check that the line is being shown.

Have a look at the html to see if there is anything there where
business_name should be displayed. View > Page Source or similar in
your browser?

Colin

when i

display this <%=@business_name %> in branch.html.erb, i didn’t get
anything…
What is the issue in this view…?

Does the puts command show a name?

  yes this  * puts "business_name.....#{@business_name}"* shows the

business name, also check the *<%= “Name = #{@business_name}” %>, and
page
source *but not showing the business_name…?

Your folder structure does not seem right. You should not have a “home”
folder. You should have a “users” folder with a “home.html.erb”