ruby - The provided regular expression is using multiline anchors (^ or $)? -
this question has answer here:
- regular expressions validations in ror 4 5 answers
i'm getting error:
the provided regular expression using multiline anchors (^ or $). did mean use \a , \z, or forgot add :multiline => true option?
when loading 1 page in rails application.
it highlights model it's using saying error is:
class associate < locations::associate
this model:
class associate < locations::associate # returns array of permissions valid @ associate level. # def self.associate_permissions associate_permissions end # generates array of permission values can used in new or edit # template. # def permission_list my_permissions = (permissions || '').split(/,/) list = [] associate.associate_permissions.each |value| list << {:label => value[0], :value => value[1], :checked => my_permissions.include? (value[1])} end list end end
the controller:
class associatescontroller < applicationcontroller def index @associates = associate.paginate :order => 'code', :page => params[:page], :per_page => 50 respond_to |format| format.html # index.html.erb format.json { render json: @associates } end end end
can tell me how solve error?
i assuming getting error while rendering index view.
update index
action with
@associates = associate.order('code').paginate(:page => params[:page], :per_page => 50)
instead of
@associates = associate.paginate :order => 'code', :page => params[:page], :per_page => 50
Comments
Post a Comment