Displaying 20 results from an estimated 30000 matches similar to: "Validation depends on Controller"
2011 Aug 01
6
Query controller using two resources
I have an activation link. I want the user to click on the link, kinda
like this...
domain.com/users/45/activate/1jf872
The number after "users" would be the user id, and the string after
"activate" would be the activation code. In the link above it would be
user id 45 and activation code 1jf872.
I have no problem sending the email. My problem is getting the route
(the url)
2010 Jul 15
3
aasm manage states
Is there a way to manage the states in AASM by keeping them in a table
to normalize the data?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2011 Jul 14
3
Have Admin add users, not the Devise Sign Up form
I have Devise working. I have roles for users working. I even added
custom fields to the User model and it seems that now everything is
working fine. So people can now subscribe using the Sign Up form
provided by Devise.
But now I need Admins, to add users. Of course, I can''t use the Sign Up
form for that. If I just use a regular User model, their passwords are
blank. Or maybe the form
2009 Dec 31
1
Single Validation Error... best practices?
So a lot of Rails apps (mine included) have multiple validations on a
single attribute. For example: on the password field, validating that
it is (a) not blank, (b) matches the confirmation, (c) is at least X
characters long, and (d) contains at least 1 alpha and at least 1
numeric character.
The problem is: if that field is blank, the default errors shows all
four. That''s a little
2010 Oct 06
4
List of html_options available
I''ve noticed lots of people online complain about not good documentation
for Rails. I''m a PHP programmer but I''m a newbie on Rails.
I''m creating a form with a drop-down menu. I finally got to do it. I
noticed there is a html_options parameter for select. I was curious as
to what other html_options are available but couldn''t find a list of
options. I
2011 Nov 22
7
rake aborted with ruby on rails
when i run * rake db:create*
*
*
WARNING: ''require ''rake/rdoctask'''' is deprecated. Please use ''require
''rdoc/task'' (in RDoc 2.4.2+)'' instead.
at
/home/vishnu/.rvm/gems/ruby-1.8.7-p352-D9TI4Ms3gBgeRYYz77F+sQ@public.gmane.org/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
DEPRECATION WARNING: Rake tasks in
2010 Oct 06
7
Passing a hash from the model to the view
I''m trying to display a drop-down menu by using an instance variable
from a model.
THIS WORKS...
<div class="field">
<%= f.label :duration %><br />
<%= f.select ("duration", {"30 minutes" => "30", "1 hour" => "60"},
:prompt => "Select") %>
</div>
THIS DOESN''T
2010 Dec 10
2
has_many, conditions overrride
I have a prod site that has:
has_many :data, :conditions => {:aasm => ''active'')
I do not want to modify it as I do not want to break existing
functionality
Is there a way to overrride this at runtime?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2011 May 21
1
Consequences of overriding update_attribute to force validation?
I know the debate of whether this should validate has been rehashed
many times. My question is, what are the consequences of overriding
this method to force validation? Will this break fundamental things?
Will it break plugins? Is there a reason not to have a strict
validation option?
In my code I will never use this as I consider it a terribly broken
method, but some gems use it and in one case
2010 Dec 02
8
CanCan issue when being very specific
So I got CanCan and Devise working well. I have two types of users:
Admins and Nonadmins. Admins can edit all of Nonadmins profiles.
The problem is, every user (either Admin or Nonadmin) belongs to an
Account or Organization. Admins should only be able to edit users from
their own Account or Organization. I was able to do that too.
The problem is, I can''t display the Create New User
2010 Feb 10
6
validation problems
Hi, there.
I have two validations in the model:
validates_numericality_of :value, :only_integer=>true,
:allow_blank=>true
validates_size_of :value, :is=>9, :message=>"must be 5-digit number",
:if=>Proc.new{|u| u.value.is_a?(Numeric)}
They work as expected except when the :value is character/string like
"a" "abc", the second validation will also output
2012 Mar 13
4
minitest validations - is there a cleaner way?
i am trying out minitest, but need some advice on a clean way to test
validations.
I setup my testing to use minitest by following the following railscast
plus i added miniskirt for Factories.
http://railscasts.com/episodes/327-minitest-with-rails
everything works well, but there has to be a cleaner way of testing failed
validations. would i be better off using something besides
2012 Mar 04
5
moving form validation to client-side
Hi I know with javascript we can validate the input of a form on the
client, is there an easy way to specify this in rails? I am thinking
the javascript code getting generated using some sort of DSL?
--
Kind Regards,
Rajinder Yadav
SafetyNet Test Driven Development
http://safetynet.devmentor.org
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2008 Oct 28
7
aasm callback order?
Hello!
Sometime ago I ran across a webpage where someone had identified the
full callback sequence for an object lifecycle including AASM with
it''s :enter and :exit and whatnot callbacks. Unfortunately, I can''t
find it and searches don''t seem to help.
Does anyone have a reference to a page that shows the callback
sequence with Acts As State Machine (the gem)?
I think
2010 Jun 07
3
Model validation giving problem
Hi,
I have a member registration form which takes a "Name", "Login",
"Password", "Confirm Password" and "Location". In the user model I have
added the validation
validate_uniqueness_of :login, validate_presence_of :password, :name,
:confirm_password.
When the member tries to register every thing working fine. I am using
same form for user to edit
2011 Jan 17
4
Factory Girl and attr_accessor with validation
I have a problem with a recent change to one of my models when created
via Factory.create.
class User < ActiveRecord::Base
attr_accessor :tc_check
validates :tc_check, :presence => true, :acceptance => true
...
end
The following definition fails, when calling
Factory.create(:valid_user)
Factory.define :valid_user, :class => User do |u|
u.email
2010 Sep 01
5
validation errors bring up stack trace error page
hello!
I made some custom validations for my app, which do catch invalid data
in the console. However, when I enter invalid data through a form on the
browser view, I get your stack trace error style page (similar to what
you see when you get a syntax error or a nil object) instead of the
nicely styled error messages (what you would see in a scaffolded
application.
First off, what is the stack
2011 Feb 28
2
form level validation, where to do it.
Form level validation involving enforcing a relation between two or
more form inputs that may not even be in the model:
I am building a form that will query a range of records between two
dates.
The form ask for a starting data and a ending date.
I want to validate that the user selected a starting data before or
equal to the ending date.
It seems that this validation should happen in the
2011 Nov 02
2
Specify and validate requirements on an ActiveRecord association
Looking for some guidance/support on what feels like might not be an
uncommon use-case.
`User.has_many accounts`
`User.has_many payment_methods`
`Account.belongs_to :user`
`Account.belongs_to :payment_method`
`PaymentMethod.has_many :accounts`
There are lots of `Accounts`. When I (a `User`) want to assign
accounts to a `PaymentMethod`, I really don''t want to scope against
all of them,
2013 Jun 28
2
Hash_Tag Client side Validation
Hi
anybody help me to find suitable validation way for Hash_Tag, My need is
user should only type hash_tag like below format.
a) #sports
b) #sports,#news
Please Help Me,
Regards,
Manoj.
--
Posted via http://www.ruby-forum.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