Join the social network of Tech Nerds, increase skill rank, get work, manage projects...

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...
Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: