0 votes
in Ruby by

Are instance variables set within a controller method accessible within a view?

 a. Yes, any instance variables that are set in an action method on a controller can be accessed and displayed in a view.

 b. Yes, instance variables set within an action method are accessible within a view, but only when render is explicitly called inside the action method.

 c. No, instance variables in a controller are private and are not accessible.

 d. No, instance variables can never be set in a controller action method.

1 Answer

0 votes
by

Are instance variables set within a controller method accessible within a view?

  Correct answer is :-  Yes, any instance variables that are set in an action method on a controller can be accessed and displayed in a view.

Related questions

+1 vote
asked Aug 26, 2022 in Ruby by Robin
0 votes
asked Aug 26, 2022 in Ruby by Robin
...