Featured
-
How Regression Testing Detects Integral Errors In Business Processes
Humans are forever changing and evolving and so to
by kristina.rigina -
Get Display Banner Advertising Opportunity on FindNerd Platform
“Do you have a product or service that nee
by manoj.rawat -
Android O Released with Top 7 New Features for App Developers
Android was founded by Andy Rubin, Rich Miner, Nic
by sudhanshu.tripathi -
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Objective C or Swift - Which Technology to Learn for iOS Development?
Swift programming language is completely based on
by siddharth.sindhi
Tags
Applying partials to layouts in rails
In Rails we can use partials to organize our code in the layouts . This is generally helpful when we have layouts running up to hundreds of lines. For example we have a top nav bar which looks different for logged in and non logged in user. Then ...
Use of :as in Passing parameters to rails partials
While passing objects to partial we can change the name of the local variable in the partial and for that purpose we need to use the :as option.
For example we have a partial _account.html.erb where we need to pass a collection @cutomers a...
Partials in Rails Application
Partials allow us to easily organize and reuse our view code in a Rails application. Partial file names typically start with an underscore (_) and generally end in the .html.erb extension as our views. The .erb extension may vary depending on tem...