Thursday, April 19, 2012

[Rails] method value passing in rails

in my ruby on rails application, i have one controller 

class HomeController < ApplicationController

def home  
   puts "name.....#{@name}" 
  end
  def branch
      //HERE  HAVE TO GET THE ABOVE FUNCTION VALUE  @name   
  end 

end

What am trying to do, i have to get the @name value  in method branch. i could show the value in function home, but i didn't get that in function branch..i have tried this with global variable, class variable...but no response....? can i use the other pgm language property like the method overriding. or inheritance..?

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate