Created
January 21, 2011 07:50
-
-
Save danhere/789382 to your computer and use it in GitHub Desktop.
This file contains 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
<%= form_for @live do |f| %> | |
<%= render "shared/error_messages", :target => @live %> | |
<%= f.label :title, "Title of Event:" %> | |
<%= f.text_field :title %> | |
<br /> | |
<%= f.label :content, "Any Additional Content:" %><br /> | |
<%= f.text_area :content %> | |
<br /> | |
<%= f.label :link %><br /> | |
<%= f.text_field :link %> | |
<br /> | |
<%= f.submit "Submit" %> | |
<% end %> |
This file contains 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
def show | |
@live = Live_Result.find(params[:id]) | |
respond_with(@live, :location => live_path) | |
end | |
def new | |
@live = Live_Result.new | |
respond_with(@live, :location => new_live_path) | |
end | |
def create | |
@live = Live_Result.create(params[:live]) | |
if @live.save | |
flash[:success] = "Upcoming meet succesfully added!" | |
respond_with(@live, :location => live_index) | |
else | |
flash[:error] = "That didn't go as well as planned. Try again." | |
respond_with(@live, :location => live_index) | |
end | |
end |
This file contains 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
resources :live, :as => 'live', :controller => "live_results" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment