On Sun, Oct 16, 2016, at 22:34, kinoe - wrote:
>  I'm assuming you want if
> @admin.save then a render or
> redirect afterwards.
> #correct,i assuming here i want input data to db with defference name.
> #means:if i have field name with value "cow" on db, i not want not have
> two "cow" name on table Box,because that i use @n as checker,are there
> name with 'cow'.'quotes'(i want make sign up with manual but here i
> assuming def create as login for my ask today).

What you're looking for is probably uniqueness check, either at model
level (validates_uniqueness_of) and/or database (unique index).

> if @n

Here, @n will always be true because you have:

> @n = Box.where(name: params[:name])

which always return trueish value even when there's no result. You need
either call `take` or use `find_by` instead or do it properly as I wrote

> #i am using hp,i hope you understand that has give.
> (:-) my english less)

Try learning English (for example, using https://id.duolingo.com/ ).

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to