Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Controller
- def new
- @supporter = Supporter.new
- end
- def create
- @supporter = Supporter.new(params[:supporter])
- if @supporter.save
- flash[:notice] = "Successfully added supporter."
- redirect_to :action => 'index'
- else
- render :action => 'new'
- end
- end
- ## Form
- - form_for @supporter do |f|
- = f.error_messages
- %p
- = f.label 'name'
- %br
- = f.text_field :name
- %p
- = f.label 'email'
- %br
- = f.text_field :email
- %p
- = f.submit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement