How does a local variable differ from an instance variable when empty?

Question:How does a local variable differ from an instance variable when empty?

1.This is not a standard rails directory, but a directory installed by RSpec in which all test files are kept.

2.The @ indicates that this is an "instance variable". An instance variable defined in the action (or function) of a controller is automatically available in the view of that same name.

3.It's a test that simulates a browser accessing our application.

4. Ruby complains if we try to evaluate an undefined local variable, but issues no such complaint for an instance variable; instead, instance variables are nil if not defined


Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!