-
-
Save nex3/109559 to your computer and use it in GitHub Desktop.
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 CourseController < ApplicationController | |
def new | |
@course = Course.new | |
end | |
def input | |
@course = Course.new(params[:course]) | |
if @course.save | |
redirect_to '/' | |
else | |
render :action => 'new' | |
end | |
end | |
def edit | |
@course = Course.find(params[:id]) | |
end | |
def update | |
@course = Course.find(params[:id]) | |
if @book.update_attributes(params[:book]) | |
redirect_to '/' | |
else | |
render :action => 'edit' | |
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
<h1>Add your schedule<h1> | |
<% form_tag :action => 'input' do %> | |
<p><label for="course_name">Course</label>: | |
<%= text_field 'course' %></p> | |
<p><label for="course_name">Course</label>: | |
<%= text_field 'course' %></p> | |
<p><label for="course_name">Course</label>: | |
<%= text_field 'course' %></p> | |
<p><label for="course_name">Course</label>: | |
<%= text_field 'course' %></p> | |
<%= submit_tag "Input your schedule" %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment