Created
December 16, 2011 11:14
-
-
Save paneq/1485683 to your computer and use it in GitHub Desktop.
Proposed solution for controller / view communication.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PapersController < ApplicationController | |
def create | |
@paper = Paper.new(params[:paper]) | |
if @paper.save | |
redirect_to @paper, notice: :created | |
else | |
flash[:alert] = :invalid | |
render action: :new | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if notice == :created %> | |
<div class="alert-message block-message success fade in" data-alert="alert"> | |
<a class="close" href="#">×</a> | |
<p> | |
<strong>Well done!</strong> You successfully proposed a paper for wroc_love.rb conference.</p> | |
<div>Please <strong>bookmark this page</strong> if you want to modify your proposal later</div> | |
<div class="alert-actions"> | |
<%= link_to "Tweet about it!", "http://twitter.com/", :class => "btn small" %> | |
<%= link_to "or not", request.path, :class => "btn small" %> | |
</div> | |
</div> | |
<% end %> | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment