Controller:
class WelcomeController < ApplicationController
def create
@welcome = WelcomeController.new
# Remove the render
end
def index
# No change
end
end
View:
div id="content"
= form_tag({:action => 'create'}, :id => 'subject_form', :remote => true) do
= submit_tag 'Add'
Create welcome/create.js.erb and add the following line to it:
$('#content').html("<%= j render(:partial => 'welcome/enjoy') %>")