# Application template recipe for the rails_apps_composer. Check for a newer version here: # https://github.com/fortuity/rails_apps_composer/blob/master/recipes/navigation.rb after_bundler do say_wizard "Navigation recipe running 'after bundler'" # Create navigation links if recipes.include? 'haml' # There is Haml code in this script. Changing the indentation is perilous between HAMLs. # We have to use single-quote-style-heredoc to avoid interpolation. create_file "app/views/shared/_navigation.html.haml" do <<-'HAML' - if user_signed_in? %li Logged in as #{current_user.name} %li = link_to('Logout', signout_path) - else %li = link_to('Login', signin_path) HAML end else create_file "app/views/shared/_navigation.html.erb" do <<-ERB <% if user_signed_in? %>