search for: each_full

Displaying 12 results from an estimated 12 matches for "each_full".

2005 Dec 15
2
Error: [Object]Controller: missing default helper path [controller]_helper
...ents to the system def add @locations = Location.find_roots @arts = Art.find_all @event = Event.new( @params[:event] ) @event.user = @session[:user] if @request.post? and @event.save redirect_to :action=>:view, :id=>@event.id else @event.errors.each_full do |msg| logger.error( "error while saving event: #{msg}") end end end end When I call http://localhost:3000/event/add/ it loads the correct view which has a variety of form elements. When I commit this form I get a blank page, and the output of WEBrick reads...
2006 Feb 10
1
Bizarre ActiveRecord::Errors/validation problem
...expected but was => <nil>. Any idea why the validate_presence_of method isn''t picking up the :port column and providing an appropriate error message like it is with name/status? Its not a reserved word or something is it? To aid debugging, here is the output of: @service.errors.each_full { |m| puts m } => Name can''t be blank => Status can''t be blank As you can see, no sign of my error message for the port column. Cheers Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachme...
2006 Aug 16
6
modeling ''phony'' fields.
Hi, I have a user model with an e-mail field. When a user registers for the site, I want them to confirm their email address by typing it in again. If they change their email address, I want them to confirm their email address by typing it in again. However, the user might change things on their account not related to their email address, such as their phone number, and they should not have
2006 May 09
3
validations erasing the form
Hi there I have a for with a couple of text_fields. I''m doing some validation via the model and when the validation "works" I get there was an error on blah blah the problem is the form is erased and I have to fill up the form again! I saw that scaffold keeps the form filled when the validation "works" but I dont know exactly what''s making it happen! I would
2009 Apr 02
3
error_messages_for does not display the error
...I gave up the old way, finding another solution. But I do not like it because ruby and rails are very elegant in their syntax. Here is what I did: in the controller I modified the destroy method like this def destroy @region = Region.find(params[:id]) @region.destroy @region.errors.each_full{|msg| flash[:error] = msg } unless @region.errors.count == 0 respond_to do |format| format.html { redirect_to(regions_url) } format.xml { head :ok } end end I know, it''s an horror, I can name many resons why including the fact that only the last error is displayed,...
2007 Jul 07
0
[patch] trunk markaby fix
...Index: camping.rb =================================================================== --- camping.rb (revision 194) +++ camping.rb (working copy) @@ -7,7 +7,7 @@ c=self/c;c="//"+ at env.HTTP_HOST+c if c[/^\//];URI(c)end;def/p;p[/^\//]?@root+p : p end;def errors_for o;ul.errors{o.errors.each_full{|x|li x}}if o.errors.any?end end;module Base;include Helpers;attr_accessor:input,:cookies,:env,:headers,:body, -:status,:root;def method_missing*a,&b;a.shift if a[0]==:render;m=Mab.new {},self +:status,:root;def method_missing*a,&b;a.shift if a[0]==:render;m=Mab.new({},self) s=m.capture{s...
2005 Dec 09
1
utf-8 BIG problems
...ost here to add to environment.rb: $KCODE = ''UTF8'' require ''jcode'' and to application.rb: before_filter :configure_charsets after_filter :fix_unicode_for_safari def parse_errors(obj) return nil if obj.nil? str = "<ul>" obj.errors.each_full do |msg| str += "<li>" + msg +"</li>" end str += "</ul>" return str end def configure_charsets @headers["Content-Type"] = "text/html; charset=utf-8" suppress(ActiveRecord::StatementInvalid) do...
2008 Jan 08
0
Error in validation
...def create @software_ci= SoftwareCi.new(params[:ci]) redirect_to :action => ''create_ui'' end The rhtml, create_ui, I have given the following ======================= <% unless @software_ci.errors.empty? %> Error occurred! <ul> <% @software_ci.errors.each_full do |message| %> <li><%= message %></li> <% end %> </ul> <% end %> The problem ================ I get the following error in the view You have a nil object when you didn''t expect it! You might have expected an instance of ActiveRecord::Base....
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
2008 Jun 02
5
validate - message in the flash[:error]
Hi, I want to show the validate - message in the flash[:error] - field but I can''t find any options. An example: class UserPermission < ActiveRecord::Base validates_presence_of :name, :message => "Please insert a name" ... | end V flash[:error] = "Error - " Has anybody a solution for this
2007 Oct 03
2
Providing HTML in an error message generated by validation
All, I have some validation that I''m doing in a model. As part of the error message, I would like to provide an HTML link. What is the best approach to handling this? APPROACH 1: One way is to include ActionView::Helpers::UrlHelper include ActionView::Helpers::TagHelper in my model so that I can use link_to to generate my link (obv. I could hard code HTML as well). But anyway that
2005 Mar 10
4
error messages, loops and saves, actionmailer and finaly authentication
Thanks to everyone who responded to my first set of questions. Not only did I get my questions answered but I improved my code and learned a couple new things. I think I prefer the mailing list over IRC... easier to follow :-) I have some more questions if you don''t mind. Some are Rails related and some are Ruby related. 1) This is concerning displaying error messages. I am assuming