Whats the difference between symbol and string?
Submitted by: AdministratorRails makes extensive use of symbols. A symbol looks like a
variable symbols name, but it's prefixed with a colon.
Examples of symbols include :action,:line_items, and :id.
Rails uses symbols to identify things. In particular, it
uses them as keys when naming method parameters and looking
things up in hashes. For example:
redirect_to :action => "edit", :id => params[:id]
Submitted by: Administrator
variable symbols name, but it's prefixed with a colon.
Examples of symbols include :action,:line_items, and :id.
Rails uses symbols to identify things. In particular, it
uses them as keys when naming method parameters and looking
things up in hashes. For example:
redirect_to :action => "edit", :id => params[:id]
Submitted by: Administrator
Read Online Ruby on Rails Job Interview Questions And Answers
Top Ruby on Rails Questions
☺ | What the difference between static scaffolding and Dynamic scaffolding? |
☺ | What is difference between form_for and form_tag? |
☺ | What are the differences betweeen Rails 2.x and Rails 3? |
☺ | Why do we use request.xhr? in rails? |
☺ | What is session and cookies? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |