Skip to content

Instantly share code, notes, and snippets.

@rbarazi
Created April 11, 2010 15:48
Show Gist options
  • Save rbarazi/362831 to your computer and use it in GitHub Desktop.
Save rbarazi/362831 to your computer and use it in GitHub Desktop.
[Beginning Rails 3] Listing 12-13. Update to app/views/layouts/application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>Blog</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag 'jquery-1.4.2.min', 'rails', 'application' %>
<%= csrf_meta_tag %>
</head>
<body>
<div id="header">
<h1><%= link_to t('general.title'), root_path %></h1>
<%= language_selector %>
<div id="user_bar">
<% if logged_in? %>
<%= link_to t('articles.new_article'), new_article_path %> |
<%= link_to t('users.edit_password'), edit_user_path(current_user) %> |
<%= link_to t('sessions.logout'), logout_path %>
<% else %>
<%= link_to t('sessions.login'), login_path %>
<% end %>
</div>
<%= render 'articles/search' %>
</div>
<div id="main">
<%= content_tag(:p, notice, :class => 'notice') if notice.present? %>
<%= content_tag(:p, alert, :class => 'alert') if alert.present? %>
<%= yield %>
</div>
<div id="footer">
<%= t('general.footer') %> <a href="http://beginningrails.com">Beginning Rails 3</a>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment