Displaying 18 results from an estimated 18 matches for "activerecordhelper".
Did you mean:
active_record_helper
2008 Jan 08
3
Unbreak ActiveRecordHelper::form() when protect_from_forgery is used
Can I get some +1s for this tiny patch? It fixes
ActiveRecordHelper::form, which is broken by default in new
applications created with Rails 2.0.
http://dev.rubyonrails.org/ticket/10739
Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To p...
2005 Dec 23
1
Overloading error_message_on method in ActiveRecordHelper
Hello all
I would like to overload the error_message_on method in the
ActiveRecordHelper module in order to emit a span tag instead of a div
tag. I try to achieve this by way of plugins: Under vendor/plugins
I''ve made a error_messages_on_fix directory, containing init.rb like
this:
---
require ''active_record_helper_fix''
---
..and a lib directory with active_...
2005 Dec 27
0
Re: RESOLVED: Overloading error_message_on method in ActiveRecordHelper
...ut, it was the method definiton itself that caused
problems. Ruby doesn''t have keyword arguments, but I tried calling the
method as if it had. But when I changed the definiton to one with a
hash that simulates keywords, it works just fine:
---
module ActionView
module Helpers
module ActiveRecordHelper
def error_message_on(object, method, params = nil)
if params.class == Hash
prepend_text = params[:prepend_text] || ""
append_text = params[:append_text] || ""
css_class = params[:css_class] || "formError"
sp...
2006 Jan 27
17
Multiple Model Validation
Hey All !
I have a form which contains two models. I would like both models to be
validated, but have their validations aggregated on the page.
If I do:
<%= error_messages_for(:model1) %>
<%= error_messages_for(:model2) %>
It puts two big validation blocks on the page. I would like all the errors
from both models, but only in one validation box.
Is this possible ? All my attempts
2006 Sep 27
2
how to get the message from validates_presence_of
hi,
I''ve a model with validates_*_of statements, but I have no idea how to
get the :message back, anyone has a clue? Thanks.
--
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 post to this group, send email to
2005 Jan 17
5
how to override rails errors messages?
hi,
how can i override rails errors mesages (that are in english) to
display them in an other language?
thanks
hangon
2006 Mar 18
1
Need help .. Rails Recipes, in_place_editor, selecting associations
Hi,
I am currently reading the Rails Recipes book and like the chapter on
providing your own in_place_editor for enumerations / selects.
I understood so far, or I believe that I understood ;-), how to do that
for a field that uses values only, like choosing from "red", "black",
"green". What I fail to understand is how to chose from associated objects?!
2006 Mar 26
1
How to override generated in validation html code?
Hi,
I would like to ask how to override validation functionality in RoR?
In active_record_helper.rb class there is "hardcoded" default html
generated durning validation.
If I will use
{code:ruby}
validates_presence_of :summary, :description
{code}
in my model class, there is html generated:
{code:html}
<div class="errorExplanation"
2005 Jul 08
2
Multiple language support
Hi
I am a newbie on Rails. I am trying to figure out how
to implement a multiple language site. How do you deal
with navigation, error messages coming from Rails etc.
Anybody have practical suggestions?
Tnx
-- PC
-- PC
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
2006 Jul 17
0
Ruby-GetText-Package-1.7.0
Hi,
Ruby-GetText-Package-1.7.0 is now available.
Enjoy L10n!
Changes
-------
* Improve to support Ruby on Rails
* Localize ActionView::Helpers::DateHelper.distance_of_time_in_words.
* Localize ActionView::Helpers::ActiveRecordHelper.error_message_on.
* Add ActiveRecord::Base.untranslate, .untranslate_all to prevend to
translate columns.
* "ID" fields are ignored as msgids. It won''t appear in po-files, now.
* Fixed bugs, code cleanup.
* Update translations
* Chinese(zh), Czech(cs), Dutch(nl),...
2006 May 04
9
Help: wrong number of arguments (0 for 1)
Is it my environment? Is something wrong, cause I thought this should
just work?
I have a simple table and I created a model and a controller:
ruby script/generate controller Restaurant
ruby script/generate model Restaurant
I edited the controller to this:
class RestaurantController < ApplicationController
scaffold :Restaurant
end
I run it and:
http://0.0.0.0:3000/Restaurant works fine,
2006 Mar 27
3
Validation - How to pop up error messages
Hi,
I''m trying to "validate" the input provided in the login form to see if
"username" is entered or not? How do i do this ?
In the model i have done like this
validates_presence_of username, :body, :message => "Missing required
field"
But I''m not this message (Missing required field ) getting printed at
all? How do i print this?
Do i need
2006 Jul 12
5
validates_peresence_of
Is there an expert validater that can point me in the right direction?
I''ve looked for extended documentation on ''validates_presence_of'' but i
can''t seem to find any.
I''m trying to make sure that i don''t enter a nil object in my database,
so i''ve added validate_presence_of to my Record Model.
i.e. -->
class Record <
2006 Aug 23
11
i18n friendly, plugable Rails Core
...ound until now. I''d love to hear your
comments and let me know if there are other examples here worth
mentioning.
ActiveRecord::Errors holds an easily configurable Hash of error
messages. Very nice. But the actual header for showing the error
messages is hardcoded in
ActionView::Helpers::ActiveRecordHelper#error_messages_for
This is inconsistent and could be fixed very easily, for instance by
adding :header and :subheader to the @@error_messages Hash.
ActionView::Helpers::DateHelper#datetime_select doesn''t support the
:order option, which is inconsisten with the ordinary date_select that
d...
2010 Aug 18
7
error_messages_for doesn't work
I''m having a problem, ''cause I wrote the following line in my model
"Hi":
[code]
validates_numericality_of :phone, :only_integer => true, :allow_blank =>
false, :message => "must be a number"
[/code]
And in my "new" view, I put:
[code]
<%= error_messages_for :oi,
:header_message => "Erro ao cadastrar
2006 Apr 23
5
Controllers in folders and helper scope in Rails >1.0
Hi,
Here''s my problem. I tried to google it, read the release-docs and
haven''t found anything similar.
My application uses folders to store controllers, as described in the
Rails book. I need to have same-named controllers for admin and for
users, so it looks like this:
/app/controllers/admin/project_controller.rb
/app/controllers/admin/...
2007 Dec 05
5
Active Record, Migration, and Translation
Hi,
I think the columns and table in migration should be able to have an
optional "display_name" set manually. Something like:
create_table :people, {display_name => "Personne"} do |t|
t.column :first_name :string, :display_name => "Prénom".
end
Let me explain my point of view:
Rails is a framework made to write programs in English. You see it when
you
2006 Jan 03
6
Am I going too far or Rails is just confusing? was {validates_presence_of *_id attributes}
Thanks for the input Blair Zajac and Chris (Nolan and Hall), and for others.
If all of you have time, please follow this (the question still
relates to the previous posts by me):
I have provided full steps to reproduce the symptoms.
If it matters, I''m running Ruby 1.8.2, Rails 1.0, and MySQL 5.0.15 on
Windows XP Professional.
1. First, the setup
MySQL
-----
create database testdb;