On Sunday, 22 April 2012 06:51:09 UTC-4, Colin Law wrote: > > On 22 April 2012 11:49, Colin Law <[email protected]> wrote: > > On 22 April 2012 11:45, amvis <[email protected]> wrote: > >> > >> i have used > >> this > http://rails-bestpractices.com/posts/57-substituting-before_filter-load_object > , > >> but i didn't get that correctly, when i use the access > >> specifier(private,protected),i am trying that for 2 days, i have got the > >> issues...can u rearrange with the above code, for accessing > >> instance variable in all action... > > > > Show us what you tried and what happened. > > Just use a simple before_filter initially to get it working. > > class BranchesController < ApplicationController > before_filter :create > > def branch > @branch = Branch.new > > * puts "name...#{@name}" //i didn't get the @name variable *
> end > > def create > @branch = Branch.new(params[:branch]) > @name = "vishnu" > end > end > > Here the create is my calling function,i mean when i click the button that create function will call, ie *Branches#create.* * What am i wrong...?* * Thank you* * vishnu* > Colin > > -- 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/-/0h7PdewiV4QJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

