[Rails] Best practice for accessing session from model

2009-12-20 Thread Lin Wj
i need to do update pm a updated_by field with a session variable user on a model after_save. but accessing session variables from models is supposedly bad whats the usual best practice for this kinda scenario ? -- Posted via http://www.ruby-forum.com/. -- You received this message because

[Rails] Re: Best practice for accessing session from model

2009-12-20 Thread Lin Wj
Thanks totally got lost ploughing thru Userstamp's code probably a good time for me to start learning some metaprogramming -- 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,

[Rails] logging in using current Windows user information

2009-08-31 Thread Lin Wj
is it possible to fetch the current logged in window user information for authentication / log in purposes ? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Help with Code Tweaking

2009-04-03 Thread Lin Wj
scenario : select distinct years from members and their respective record count of that particular year. eg: [{year = 2008 , count = 45123},{year = 2007 , count = 12332} ] previously , i was using select distinct tochar(datetime) , it ended up taking quite a while to fetch the records so i

[Rails] Re: ActiveWebService returning custom types

2009-03-02 Thread Lin Wj
nevermind the above posts i wasnt paying attention i created a model Sample changed code to class TestApi ActionWebService::API::Base api_method :get_me, :returns = [Sample] end class MarketdataController ApplicationController ... def poll Sample.find(:all,:limit =1) end

[Rails] how to use Wsdl2ruby generated files

2009-03-02 Thread Lin Wj
i am cloning a current soap server to ruby and i have zero experience in this soap thing. i did a wsdl2ruby on the url and generated 3 riles DriverDataServiceMappingRegistry.rb DriverDataService.rb DriverServiceServant.rb how do i use the files to setup a soap server ? -- Posted via

[Rails] ActiveWebService returning custom types

2009-03-01 Thread Lin Wj
class Sampleclass attr_reader :temp_arr,:temp_hash,:temp_str def initialize(temp_arr,temp_hash,temp_str) @temp_arr=temp_arr @temp_hash=temp_hash @temp_str=temp_str end class TestApi ActionWebService::API::Base api_method :get_me, :returns = [Sampleclass] end class

[Rails] Re: ActiveWebService returning custom types

2009-03-01 Thread Lin Wj
disregard this section #[get_indices(),get_stocks(),get_summary(),DateTime.now.to_s] indices = get_indices() stocks = get_stocks() summary = get_summary() current_time = DateTime.now tempsnapshot = Snapshot.new(indices,stocks,summary,current_time) tempsnapshot

[Rails] Actionwebservice for rails2.2.2 / ruby 1.8.7

2009-02-27 Thread Lin Wj
has anyone gotten action actionwebservice to work for this config ? tried instructions from http://www.texperts.com/2007/12/21/using-action-web-service-with-rails-20/ and got a activate': can't activate actionpack on server startup -- Posted via http://www.ruby-forum.com/.

[Rails] strict XHTML compliant ajax library

2009-02-26 Thread Lin Wj
problem : i have to develope a app using ajax features and it has to run in an environment(web tv related) which is very strict about XHTML compliance. and ajax codes generated by rails doesnt seem to be compliant. (they work on normal webpages , but not in the webtv env) other than writing my

[Rails] setting header in views?

2009-01-13 Thread Lin Wj
currently iam using FasterCSV to render csv pages format.csv do csv_string = FasterCSV.generate do |csv| # header row csv @query_result[0].keys @query_result.each do |x| csv x.values end end #send it to the browser