then press create if any validate require page will redirect to it
actual controller for ex. admins/new something like this
i want display validation message on same page in this command url can
not change in all page url remain same, if any one having idea about it
please share with me.
----------------------
it is my contrller
--------------------
def create
@animal = Animal.new(params[:animal])
respond_to do |format|
if @animal.save
flash[:notice] = 'Animal was successfully created.'
format.html { redirect_to(@animal) }
format.xml { render :xml => @animal, :status => :created,
:location => @animal }
else
format.html { render :action => "new" }
format.xml { render :xml => @animal.errors, :status =>
:unprocessable_entity }
end
end
end
----------------
model vaidation
----------------
class Animal < ActiveRecord::Base
validates_presence_of :name,:desc
end
------------------------
i want to show validation on same page whenever refresh page go to on
main page
then press create if any validate require page will redirect to it
actual controller for ex. admins/new something like this
i want display validation message on same page in this command url can
not change in all page url remain same, if any one having idea about it
please share with me.