[Rails] Re: CSS issue with div fieldWithErrors
Ok I found a fix: put that in an initializer: ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| span class=\fieldWithErrors\#{html_tag}/span end -- 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: CSS issue with div fieldWithErrors
Fernando Perez wrote: Hi, What's the correct way of writing a form? I do the following: %= form_for ... % p %= f.label :whatever % %= f.text_field :whatever % /p %- end -% Then I do some CSS to have all the labels aligned, and all the input fields aligned. The problem happens when a field is not valid, Rails wraps it in this stupid div with class fieldWithErrors (and what the hell is that camelCaseCrap?), so it blows my design out. If that's ruining your design, then your CSS has problems. It should be easy to define the CSS for fieldWithErrors so it doesn't cause layout issues. (And it's not stupid -- it's a way of clearly showing the user where the errors are.) For myself, I don't have this problem because I lay out my forms with table elements. (Stop screaming. :) They have the semantics of tables, so this is justified.) Is there somewhere some easy CSS to circumvent that trouble? Nothing fancy, just a simple and clean form. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: CSS issue with div fieldWithErrors
If that's ruining your design, then your CSS has problems. Nope. It is extremely common, to see forms created with p tags to separate each input. A div inside a p tag is not allowed by html standards, look for the internet, plenty people have this div problem. But you are right with tables, they can greatly simplify css and avoid headaches, I already use tables for some of my layouts because they are 100% cross browser compatible. -- 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: CSS issue with div fieldWithErrors
Fernando Perez wrote: If that's ruining your design, then your CSS has problems. Nope. Yup. It is extremely common, to see forms created with p tags to separate each input. A div inside a p tag is not allowed by html standards, look for the internet, plenty people have this div problem. Then p tags are not the right thing to use here. Replace them with divs. Problem solved. But you are right with tables, they can greatly simplify css and avoid headaches, I already use tables for some of my layouts because they are 100% cross browser compatible. Not always. And I'm certainly not advocating table-based layouts in general -- only when the semantics are actually tabular. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: CSS issue with div fieldWithErrors
How do you manage that? IE 5, 6 and 7 don't support the table element :P. If I had my choice, I'd use them too, but until IE 6 and 7 finally die... I can't do it! On Oct 1, 5:48 am, Marnen Laibow-Koser rails-mailing-l...@andreas- s.net wrote: Fernando Perez wrote: Hi, What's the correct way of writing a form? I do the following: %= form_for ... % p %= f.label :whatever % %= f.text_field :whatever % /p %- end -% Then I do some CSS to have all the labels aligned, and all the input fields aligned. The problem happens when a field is not valid, Rails wraps it in this stupid div with class fieldWithErrors (and what the hell is that camelCaseCrap?), so it blows my design out. If that's ruining your design, then your CSS has problems. It should be easy to define the CSS for fieldWithErrors so it doesn't cause layout issues. (And it's not stupid -- it's a way of clearly showing the user where the errors are.) For myself, I don't have this problem because I lay out my forms with table elements. (Stop screaming. :) They have the semantics of tables, so this is justified.) Is there somewhere some easy CSS to circumvent that trouble? Nothing fancy, just a simple and clean form. Best, -- Marnen Laibow-Koserhttp://www.marnen.org mar...@marnen.org -- Posted viahttp://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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: CSS issue with div fieldWithErrors
Josh Infiesto wrote: How do you manage that? IE 5, 6 and 7 don't support the table element :P. Of course they do. If I had my choice, I'd use them too, but until IE 6 and 7 finally die... I can't do it! Nonsense. On Oct 1, 5:48�am, Marnen Laibow-Koser rails-mailing-l...@andreas- Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: CSS issue when using SubUri and Passenger
SOLVED ... discover some CSS link redefinition missing the relative URL root !! On 20 juil, 13:47, Erwin yves_duf...@mac.com wrote: I am testing another application in local in my environment.rb I wrote config.action_controller.relative_url_root = /elnino config.action_controller.asset_host = http://opticoaching.local; I defined correctly the vhost (I have already odne it for another app which is running well...) VirtualHost *:80 ServerName opticoaching.local DocumentRoot /Users/yves/Sites/rails/opticoaching RailsEnv development RailsDefaultUser yves RailsBaseURI /elnino Directory /Users/yves/Sites/rails/opticoaching/elnino/public/ Options Indexes FollowSymLinks MultiViews AllowOverride All /Directory /VirtualHost opticoaching.local is registered (as usual) in my etc/hosts executinghttp://opticoaching.local/elnino, the CSS and images are not taken in account .. http://opticoaching.local/elnino/http://opticoaching.local/images/elnino.jpghttp://opticoaching.local/stylesheets/application.css what could be wrong ? I already did it for another application without any problem .. cannot find the differences... thanks for you suggestions --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: CSS issue...
Abhishek shukla wrote: How can i call a stylesheet other then from /public/stylesheets/ folder.. %= stylesheet_link_tag /themes/style % must be work -- 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: CSS issue...
Abhishek shukla wrote: I am calling css file from following folder %= stylesheet_path(#{RAILS_ROOT}/public/themes/style.css) % I think that should be stylesheet_tag. Then take the RAILS_ROOT and public out. You are generating HTML for a web browser, and it can only hit your web browser (roughly speaking) from below the public folder. %= stylesheet_tag('themes/style.css') % --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: CSS issue...
Abhishek shukla wrote: Hello friends I am calling css file from following folder %= stylesheet_path(#{RAILS_ROOT}/public/themes/style.css) % And getting the following error any idea? ActionController::RoutingError (No route matches /home/user/test/testapp/public/themes/style.css with {:method=:get}): Regards Abhi Is this code in between your head tags? Can't you use: %= stylesheet_link_tag style % -- 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: CSS issue...
How can i call a stylesheet other then from /public/stylesheets/ folder.. On 4/14/09, Shandy Nantz rails-mailing-l...@andreas-s.net wrote: Abhishek shukla wrote: Hello friends I am calling css file from following folder %= stylesheet_path(#{RAILS_ROOT}/public/themes/style.css) % And getting the following error any idea? ActionController::RoutingError (No route matches /home/user/test/testapp/public/themes/style.css with {:method=:get}): Regards Abhi Is this code in between your head tags? Can't you use: %= stylesheet_link_tag style % -- 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---