Skip to content

Instantly share code, notes, and snippets.

@garethrees
Created April 5, 2012 08:38
Show Gist options
  • Save garethrees/2309215 to your computer and use it in GitHub Desktop.
Save garethrees/2309215 to your computer and use it in GitHub Desktop.
Flash outputs random 0
= if notice
#notice
%p
= notice
%h2.breadcrumb
= link_to 'Sites', admin_sites_path
= render :partial => "shared/noticedisplay"
%h1 Sites (Campuses) #{link_to_icon 'add', new_admin_site_path}
<h2 class="breadcrumb">
<a href="/admin/sites">Sites</a>
</h2>
<div id="notice">
<p> The testy campus was successfully created. </p>
</div>
0
<h1>
Sites (Campuses)
<a class="icon add_icon" href="/admin/sites/new">
<img src="/images/icons/add.png?1333534032" alt="Add">
</a>
</h1>
def create
@site = Site.new(params[:site])
if @site.save
redirect_to(admin_sites_path,:notice => ["The "+@site.name+" campus was successfully created."])
else
redirect_to(admin_sites_path,:error => ["Campus creation failed!"])
end
end
@garethrees
Copy link
Author

Hah, should have spotted that. Like I said, I don't use haml much :P

Edit: Referencing Keeran's spot

Use - instead of = for conditionals:

- if notice 
  #notice
    %p
      = notice

@barryrichards
Copy link

Yup, that's the error. Not a bug. Blame the coder ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment