Getting messages from Model

Hi Shandy,

you do something like this in your controller, (assume User is the name of model)

class MyController < ApplicationController   def create # do what ever validation you want for the incoming parameters, and i'll assume params[:user] contains all attribute necessary for creation of user user = User.new(params[:user])

     begin        x.save!      rescue Exception => e           puts x.errors['password'] # this will print the error message you have given, so do what ever you want with this( i am just printing)           # password is the field name in database table, which can be any column you want.           puts e.message # even this will contains the error message.      end   end end