Hi everyone,
In a User model has 4 columns mandatory I have used validate presence true
first_name, last_name, username, country.
Now if the user is admin and when I want to update his details I don't want
to check country I want validate presence part from country. In this case
how can I do
On 14 October 2015 at 08:56, honey ruby wrote:
> Hi everyone,
>
> In a User model has 4 columns mandatory I have used validate presence true
> first_name, last_name, username, country.
> Now if the user is admin and when I want to update his details I don't want
> to
am using Rails 3.2.21 I forgot to mention that.
Thanks
On Wed, Oct 14, 2015 at 1:26 PM, honey ruby
wrote:
> Hi everyone,
>
> In a User model has 4 columns mandatory I have used validate presence true
> first_name, last_name, username, country.
> Now if the user is
Thanks colin for your reply.
I have used this way in my model.
validates :first_name, :last_name, :username, :next_of_name, :phone,
:email presence: true
validates :first_name, :last_name, :username,:password,
:password_confirmation, :presence => true, if: :only_for_admin
def
On 14 October 2015 at 12:41, honey ruby wrote:
> Thanks colin for your reply.
>
> I have used this way in my model.
>
> validates :first_name, :last_name, :username, :next_of_name, :phone,
> :email presence: true
> validates :first_name, :last_name,
5 matches
Mail list logo