Skip to content

Commit

Permalink
factor out type
Browse files Browse the repository at this point in the history
  • Loading branch information
zr2d2 committed Jun 24, 2012
1 parent 566a7fe commit 96eff44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def show
def new
@template = Template.new
@template.media.build
@type = params[:type] || 'import'

respond_to do |format|
format.html # new.html.erb
Expand Down
4 changes: 2 additions & 2 deletions app/views/templates/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
<section class="C no">
<header id="template-header">
<%= back_button "#", :back %>
<h1><%= (params[:type] || 'import').capitalize + " Template" %></h1>
<h1><%= @type.capitalize + " Template" %></h1>
</header>
<div class="C-cont">
<article>
<% if params[:type] == "create" %>
<% if @type == "create" %>
<%= render 'create_form' %>
<% else %>
<%= render 'import_form' %>
Expand Down

0 comments on commit 96eff44

Please sign in to comment.