Re: [Rails] Pass a ruby variable into js within Rails

2014-05-29 Thread Dave Sims
I've used the gon gem for this and liked it quite a bit. https://github.com/gazay/gon Pierre-Andre M. wrote: I have a variable created by some ruby in my controller that looks like this: @begpoint = row["begpoint"] and I want to pass it into some js that is referenced from within my view:

Re: [Rails] Phonegap + Rails to render the views. How does Facebook Connect work then?

2013-11-18 Thread Dave Sims
One solution might be to hand off authentication to a native control, use the native FB SDK to authenticate and get the token, and then back to the PhoneGap webview. I've used this hybrid approach with Rails and PhoneGap, and it's been a decent compromise. Use Rails for what it does well, but lever

Re: [Rails] Re: What is the purpose of :conditions on a belongs_to asso

2010-01-28 Thread Dave Sims
0 at 3:40 PM, Dave Sims wrote: > >> Upon further inspection I do see that the condition will restrict the * >> retrieval* of items (and even then only after they are reloaded), but not >> the persistence. I can assign an invalid object (invalid according to the >> condition

Re: [Rails] Re: What is the purpose of :conditions on a belongs_to asso

2010-01-28 Thread Dave Sims
invalid attribute will be available on that object in memory until the object is reloaded. On Thu, Jan 28, 2010 at 2:00 PM, Robert Walker wrote: > Dave Sims wrote: > > But the output shows no WHERE clause on the select, and in any case I > > would > > expect that conditions like

[Rails] What is the purpose of :conditions on a belongs_to association?

2010-01-28 Thread Dave Sims
Say I have the following association with an attached condition: belongs_to :admin_user, :class_name => 'User', :foreign_key => :admin_user_id, :conditions=> 'users.admin=TRUE' # or any variation with hash or array, {:admin => true}, etc. The API states