Gotchya with input = :check_box

0 views
Skip to first unread message

Luke Melia

unread,
Oct 1, 2009, 5:09:09 PM10/1/09
to admin_a...@googlegroups.com
Unlikely to affect too many others, but just in case:

We run on a vendored copy of rails 2-3-stable, and admin_assistant
uses the RAILS_GEM_VERSION constant to decide how to render the
checkbox/hidden field combo when you say form[:fieldname].input
= :check_box

Our RAILS_GEM_VERSION happened to be set to 1.2.3, so our checkboxes
were not working.

My workaround for now is to set the RAILS_GEM_VERSION in our
environment.rb to the closest thing to what we're running (2.3.4)

Cheers,
Luke
--
Luke Melia
lu...@lukemelia.com
http://www.lukemelia.com/

Francis Hwang

unread,
Oct 6, 2009, 6:43:29 AM10/6/09
to admin_a...@googlegroups.com
Funny, just the other day I was thinking to myself that there should
be a better way to do that. I toyed with the idea of just trying to
call whatever Rails' check_box_tag is calling, but when I started
looking at how those helpers are defined internally I recoiled in
fear. I'm no Yehuda.

Luke, are there downsides for you of setting RAILS_GEM_VERSION, and/or
is there another way you'd prefer to specify this so admin_assistant
knows what to do?

Francis Hwang
http://fhwang.net/

Alex Farrill

unread,
Oct 6, 2009, 8:42:12 PM10/6/09
to admin_assistant
Hey, I'm *achem* upgrading some admin_assistant code from 0.0.1 to 1.0.0 and finding some different behavior was introduced at some point.
I'm trying to do on an index page:

index.search "CONCAT_WS(' ', users.first_name, users.last_name)"

Yes, some honest to god SQL.  This command used to get me some real juice, but now I just get:
 
Virtual search column :"CONCAT_WS(' ', users.first_name, users.last_name)" needs a conditions block
Is there a new way to do raw sql search conditions or has the functionality been dropped?
I, for one, am a fan of such things.
Thanks,
Alex
Reply all
Reply to author
Forward
0 new messages