Skip to content

Instantly share code, notes, and snippets.

@Zhomart
Created July 18, 2012 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zhomart/3135558 to your computer and use it in GitHub Desktop.
Save Zhomart/3135558 to your computer and use it in GitHub Desktop.

in QuestionsController

if @question.set(:deleted => true)
  flash[:notice] = render partial: 'notice_undo_delete_question'

  redirect_to :back
else
  render :edit
end

in application.html.erb (layout)

<% if flash[:notice] %>
  <div class="notification"><%= flash[:notice] %></div>
<% end %>
<%= yield %>

questions/_notice_undo_delete_question.html.erb

/ Here goes some beautiful styling
you have deleted the questions
/ here too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment