Cedric Fung
Not a member
Cedric Fung's latest activity
Thursday, June 17 2010
4841
multiple select only keep the last one
was updated
in Ruby on Rails
-
Cedric Fung commented at 10:27 AM -
Cedric Fung commented at 9:13 AMyes, this work
select("(title, location, (latitude-#{lat})(latitude-#{lat}) + (longitude-#{lon})(longitude-#{lon})) AS distance")but if I have many scope, ve...
-
Cedric Fung commented at 8:59 AMI have two named scope
I don't wanna transfer all attributes through the mobile network, so I create a 'simple' scope
scope :tiny, select('title, location')i...
Monday, June 14 2010
4841
multiple select only keep the last one
was updated
in Ruby on Rails
-
Cedric Fung commented at 2:28 PMthis just a demo.
I won't use Event.select('title').select('location_title') directly. I just demonstrate the situation.
Saturday, June 12 2010
4841
multiple select only keep the last one
was created
in Ruby on Rails
-
Cedric Fung created the ticket at 10:18 AMI use rails 3b4
this will return location_title
irb(main):001:0> Event.select('title').select('location_title').limit(1) => [#<Event location_title: "Shanghai"...
4840
to_xml doesn't work in such case: Event.select('title as t').to_xml
was created
in Ruby on Rails
-
Cedric Fung created the ticket at 10:11 AMI use ruby 1.9.2 preview3 and rails 3b4
The simple select works well
irb(main):042:0> Event.select('title').limit(3).to_xml => "<?xml version=\"1.0\" encoding=...
Friday, June 11 2010
4810
Responder dosen't care params[:format]
was updated
in Ruby on Rails
-
Cedric Fung commented at 4:56 AMIt won't work, my log output
this from beta3
====================================== params[:format] = xml ====================================== Processing by ... -
Cedric Fung commented at 3:49 AMbut I use new responder syntax in rails 3
class UsersController < ApplicationController respond_to :html, :mobile def index @users = User.all re...
Wednesday, June 09 2010
4810
Responder dosen't care params[:format]
was created
in Ruby on Rails
-
Cedric Fung created the ticket at 5:09 PMI have some code like this
before_filter :detect_browser def detect_browser params[:format] = 'mobile' if request.headers["HTTP_USER_AGENT"].match(MOBILE_BR...