Skip to content

Instantly share code, notes, and snippets.

@lastk
Created June 26, 2010 23:08
Show Gist options
  • Save lastk/454430 to your computer and use it in GitHub Desktop.
Save lastk/454430 to your computer and use it in GitHub Desktop.
class ArtistsController < ApplicationController
def index
redirect_to :action => "new"
end
def new
@artist = Artist.new(params[:artist])
end
def create
@artist = Artist.new(params[:artist])
if @artist.name == "rafael"
render :text => "ok"
else
redirect_to :action => "new", :artist => @artist
end
end
end
<% form_for @artist do |f| %>
<div>
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<%= f.submit :Save %>
<% end %>
@scottswezey
Copy link

Line 17 should read:
render :action => 'new'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment