i want to render an action from another controller, but i get the error:
undefined method `formats' for nil:NilClass
<script>
$("#validate_company").live("keyup", function() {
$("#company_info").html("<%= escape_javascript(render(:controller => 'live_validation', :action => 'validate_client_company')) %>");
});
</script>
This is the Controller:
class LiveValidationsController < ApplicationController
def validate_client_company
if params[:first_name].length > 0
@client = Client.find_by_company(params[:company])
if @client.nil?
@message = "<img src='/images/accepted_48.png' alt='Valid Username'/>"
else
@message = "<img src='/images/cancel_48.png' alt='Invalid Username' /> Name taken"
end
else
@message = ""
end
render :partial => "message"
end
end
The partial _message is just
<%= @message %>