I'm on EdgeRails, and I can't seem to get .rjs files to be used
automatically. I've looked at Cody's (and others) tutorials, and I
always have to say ".rjs", even when it's the only one there!
For example:
def show
format.html { render :action => 'show.rjs' } # notice explicit
".rjs"
end
Instead of:
def show
format.html { render :action => 'show' }
end
Got it: You have to put this in a format.js under EdgeRails:
def show
@user_role = UserRole.find(params[:id])
respond_to do |format|
format.js { render :action => 'show' }
format.html { raise "AJAX only for this action" }
format.xml { render :xml => @user_role.to_xml }
end
end