From: Paul Mckibbin Date: 2008-03-21T13:30:36+09:00 Subject: Re: if-less if statements Paul Mckibbin wrote: >> On Thu, 20 Mar 2008 09:01:48 -0500 >>> Anyone have any suggestions? Thanks, > Actually, and this is definitely more appropriate to the rails forum, you should really have this in you user_helper.rb or application_helper.rb file and called it from the view. e.g. In the view: <%= in_place_editor_field 'user','w_phone', check_red_style(@user.w_phone), :cols=>20%> In the application_helper.rb file: module ApplicationHelper def check_red_style(input,test=/Click to edit|Check format/) (input=~test) ? {:style=>'color:red'} : {} end end and then you can use whatever regular expression you want from the view (although check that you can have nested helpers, I don't think it's a problem, but I don't have a scratch rails area to test it on). Mac -- Posted via http://www.ruby-forum.com/.