[Rails] Re: CamelCase and Underscores

2010-07-10 Thread Kenneth    
MattB wrote: variable_name method_name But why?! Since methods don't need (), how are we supposed to instinctively know what's a method and what isn't when reading someone elses code? (Or our own when we've forgotten what we wrote!) Matt. PS. Anyone play spot the Ruby Newbie, score

[Rails] Re: How to set JQuery's effect for normal link

2010-07-10 Thread Tushar
well you have to use link_to_function method see on http://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html#M002237 its is similar to link_to_remote ajax in ror you also shuold have jrails working in your view %= link_to_function(Avoid Ajax Call, nil, :id = more_link) do |

[Rails] Multi databases in rails 3

2010-07-10 Thread trung
Is there any support for multiple databases in Rails 3? Either natively through ActiveRecord or third party gem? Thanks. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to

[Rails] Very noobish question

2010-07-10 Thread Dd Ss
So I just started with rails a few days ago and I am wondering why this does not work. I get an ArgumentError in User#create Extracted source (around line #2): 1: 2: % form.for :user, @user, :url = {:action = create}, :html = {:class = create_form} do |f| % 3: 4: p 5: %= f.label

[Rails] Re: how do I fix this?

2010-07-10 Thread Frederick Cheung
On Jul 10, 4:43 am, Angel Robert Marquez angel.marq...@gmail.com wrote: ruby 1.9.3dev (2010-07-06 trunk 28554) [i686-linux]Rails 3.0.0.beta4 Fedora Release 13 Kernel Linux 2.6.33.5-124.fc13.i686.PAE GNOME 2.30.0 After I scaffold, migrate, link_to posts_path,  and check click on new post

[Rails] Re: Very noobish question

2010-07-10 Thread Frederick Cheung
On Jul 10, 8:37 am, Dd Ss li...@ruby-forum.com wrote: So I just started with rails a few days ago and I am wondering why this does not work. I get an ArgumentError in User#create Extracted source (around line #2): 1: 2: % form.for :user, @user, :url = {:action = create}, :html = That

[Rails] Re: Very noobish question

2010-07-10 Thread Marnen Laibow-Koser
Dd Ss wrote: So I just started with rails a few days ago and I am wondering why this does not work. I get an ArgumentError in User#create Yes? And what's the rest of the error message? Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from my iPhone -- Posted via

Re: [Rails] SOAP web service

2010-07-10 Thread Mark Kremer
You could try soap4r: http://dev.ctor.org/soap4r On 6-7-2010 15:48, codefusurfer wrote: I am looking for a way to host a SOAP Webserver that serves the data as SOAP document/literal. I know actionwebservice support SOAP RPC/ encoded mode but I need document/literal. Anyone knows how to do this?

[Rails] Re: deployment question: has anyone deployed w. sqlite?

2010-07-10 Thread Lille
Thank you all for your comments. @Phillip, @Marnen - I didn't know about the sqlite concurrency factor, thanks... On Jul 9, 5:00 pm, Greg Donald gdon...@gmail.com wrote: On Fri, Jul 9, 2010 at 3:42 PM, Philip Hallstrom phi...@pjkh.com wrote: Just to play devil's advocate... sqlite is fine for

Re: [Rails] Re: need pdf gen which is support to Asian languages

2010-07-10 Thread Mark Kremer
While Prawn does support UTF-8, it doesn't mean you can print all Asian characters. To print Asian characters you'll need to have a font (a TTF file if I remember it correctly) that supports them and use that with Prawn, I don't think the built in fonts support Asian characters. On 8-7-2010

[Rails] Re: need pdf gen which is support to Asian languages

2010-07-10 Thread nirosh
i integrate the google indic in my app. So which font i have to use to print those characters in prawn. i almost stuck here. On Jul 10, 4:42 pm, Mark Kremer m...@without-brains.net wrote: While Prawn does support UTF-8, it doesn't mean you can print all Asian characters. To print Asian

[Rails] no bundle command?

2010-07-10 Thread David Zhu
First of all, I had to run sudo to install bundler cause it was complaining that it didn't have access to /var/ruby blah what ever So now bundler is installed, if i run gem list bundler is among one of them Now if i run bundle install it complains that bundler: command not found Um

[Rails] Re: Re: need pdf gen which is support to Asian languages

2010-07-10 Thread Marnen Laibow-Koser
Mark Kremer wrote: While Prawn does support UTF-8, it doesn't mean you can print all Asian characters. Yes it does, and you even go on to explain how. To print Asian characters you'll need to have a font (a TTF file if I remember it correctly) that supports them and use that with Prawn, I

Re: [Rails] Re: Update Ruby Version!

2010-07-10 Thread Fidel Viegas
On 7/10/10, Phillip Koebbe li...@ruby-forum.com wrote: David Zhu wrote: Hey guys I am running Ruby 1.8.7 on Ubuntu 10.04 How can I update it to 1.9.1? I tried instaling the 1.9.1 package, everything seemed to work, but if I run ruby -v it still says 1.8.7. I might be doing something

Re: [Rails] Re: Very noobish question

2010-07-10 Thread Andre Joseph Cubeta
Try to understand the standard 7 object method called restfull API and it will make your life easier in rails. Application. Try checking http://railscas.com for a start. Cheers, Andre Sent from my iPhone On Jul 10, 2010, at 7:09 PM, Marnen Laibow-Koser li...@ruby-forum.com wrote: Dd Ss

[Rails] `method_missing': undefined method `i18n' for #Rails::Railtie::Configuration:0x000001010fce98

2010-07-10 Thread Kristian Mandrup
I have recently upgraqded to Ruby 1.9.2-rc1 and reinstalled rails 3 beta 4 with all the dependencies. I have run bundle install in my rails project. Now I am trying to run some tests... My test_helper.rb file looks like this: # test_helper.rb require 'rubygems' require 'test/unit' require

[Rails] Additional methods in models - how to access them?

2010-07-10 Thread Szymon Przybył
Hi! I'm new in Rails and I'm making my first site using this. I have some problem with methods in models: I have model Note with one additional method: class Note ActiveRecord::Base belongs_to :pattern def get_location(location) find(:conditions = [location = ?, location]) end end

[Rails] Rails 3 convert time of created_at before saving to MySQL

2010-07-10 Thread Sharkie Landshark
How can I prevent this? This happens even if I do not set config.time_zone Basically Rails 3 subtract 7 hours from the current time before saving it to MySQL. I never had this issue in Rails 2.3.5. How would I disable this functionality? Sharkie -- Posted via http://www.ruby-forum.com/. --

[Rails] Re: Rails 3 convert time of created_at before saving to MySQL

2010-07-10 Thread Sharkie Landshark
I understand a little better now. I am in Bangkok time. Rails converts time into UTC before saving it to MySQL. I do not wish for this behavior. I would rather have created_at stored as Bangkok time as was always the case in Rails 2.3.5. I never wish for this UTC time. -- Posted via

[Rails] Re: Additional methods in models - how to access them?

2010-07-10 Thread Szymon Przybył
I'm trying to get Note from this Pattern (which has many notes) with location = 1 for example, how I can do it in rails? simon On 10 Lip, 18:08, Frederick Cheung frederick.che...@gmail.com wrote: On Jul 10, 4:22 pm, Szymon Przybył apocalyp...@gmail.com wrote: Hi! I'm new in Rails and

[Rails] Re: Rails 3 convert time of created_at before saving to MySQL

2010-07-10 Thread Sharkie Landshark
Further investigation, MySQL is running in ICT (Bangkok Time) mysql select distinct @@system_time_zone from user; ++ | @@system_time_zone | ++ | ICT| ++ 1 row in set (0.00 sec) Sharkie -- Posted via

[Rails] Re: Additional methods in models - how to access them?

2010-07-10 Thread Szymon Przybył
But even if I call Note.get_location(1), it throws the same error :/ What i'm doing wrong? simon On 10 Lip, 18:08, Frederick Cheung frederick.che...@gmail.com wrote: On Jul 10, 4:22 pm, Szymon Przybył apocalyp...@gmail.com wrote: Hi! I'm new in Rails and I'm making my first site using

[Rails] Re: Very noobish question

2010-07-10 Thread David Zhu
Try to understand the standard 7 object method called restfull API and it will make your life easier in rails. Application. Try checkinghttp://railscas.comfor a start. Its actually http://www.railscasts.com ryan bate's video screencasts, they really realy help -- You received this

Re: [Rails] Re: Additional methods in models - how to access them?

2010-07-10 Thread Leonardo Mateo
On Sat, Jul 10, 2010 at 1:48 PM, Szymon Przybył apocalyp...@gmail.com wrote: But even if I call Note.get_location(1), it throws the same error :/ As Frederick says, this is an instance method, you're trying to call it on the class. You should do something like @pattern.notes.first.get_location I

[Rails] Re: Additional methods in models - how to access them?

2010-07-10 Thread Szymon Przybył
This works: pattern.notes.first(:conditions = {:location = location}) But I want use it in views, pattern.notes.get_location(location) looks much better, but how can I make it works? cheers! simon On 10 Lip, 18:08, Frederick Cheung frederick.che...@gmail.com wrote: On Jul 10, 4:22 pm, Szymon

Re: [Rails] Rails 3 convert time of created_at before saving to MySQL

2010-07-10 Thread Jeffrey L. Taylor
Quoting Sharkie Landshark li...@ruby-forum.com: How can I prevent this? This happens even if I do not set config.time_zone config.time_zone = 'Bangkok' or the appropriate value among the output of: rake time:zones:local HTH, Jeffrey -- You received this message because you are

[Rails] Routing problem

2010-07-10 Thread Leonardo Mateo
Hi guys, I'm having a problem with nested routes and I don't know what I'm missing. I have a products resource, which has a available collection action. map.resources :courses, :member = { :confirm = :get}, :collection = { :available = :get } Then I have the users resource, which has many

Re: [Rails] Re: CamelCase and Underscores

2010-07-10 Thread Philip Hallstrom
On Jul 9, 2010, at 6:21 PM, MattB wrote: You shouldn't need to. Because... (?) (Not being facetious). Because for all practical purposes they are the same thing. They aren't of course, but only the class itself should know or care about that. Look at ActiveRecord... say I've got a

Re: [Rails] Re: how do I fix this?

2010-07-10 Thread Angel Robert Marquez
Appreciate the help FC. The only file that is in config/locales is en.yml. I haven't changed or moved anything that I am aware of. How do I make yml a known file type? can not load translations from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta4/lib/active_support/locale/en.yml,

[Rails] Re: no bundle command?

2010-07-10 Thread David Zhu
First of all, I had to run sudo to install bundler cause it was complaining that it didn't have access to /var/ruby blah what ever So now bundler is installed, if i run gem list bundler is among one of them Now if i run bundle install it complains that bundler: command not found Sorry

[Rails] Re: Routing problem

2010-07-10 Thread Sijo k g
Hi Leonardo map.resources :courses, :member = { :confirm = :get}, :collection = { :available = :get } Then I have the users resource, which has many products map.resources :users, :has_many = [:subscriptions, :courses] Assuming what you specified products is courses. Change your

[Rails] Merge 2 user tables?

2010-07-10 Thread David Zhu
Hey there I have 2 tables, one for admins and another for regular users. (i used authlogic to make them) Now, there has to be 2 different login forms for the 2 different types of users. Is there anyway to have 1 form, for the 2 diff types of users? Thank you -- You received this message

[Rails] Re: Rails 3 convert time of created_at before saving to MySQL

2010-07-10 Thread Sharkie Landshark
I tried this, and it does not work and seems to have no effects. What happen now is that created_at is stored in MySQL in UTC time, but when retrieved and displayed in Rails it shows in Bangkok time. It is really no problem with all new data. However, with legacy data in MySQL which have been

[Rails] Re: Very noobish question

2010-07-10 Thread dfx
I'm not sure if this is the reason or not, but form.for should be form_for in views/user/create.html.erb. Hope this helps. I'm not sure if this is the reason, but form.for should be form_for On Jul 10, 12:37 am, Dd Ss li...@ruby-forum.com wrote: So I just started with rails a few days ago and

[Rails] how do you pronounce git?? :D

2010-07-10 Thread David Zhu
Hey How do you pronounce git? Is it like jit? or is it more like gghit? I know ryan b pronounces it the second way ;) Not sure how it's supposed to pronounced. I pronounce it the first way. Just wondering. I need some input on this? :) -- You received this message because you are subscribed

[Rails] Re: Generate PDF and attach to email on the fly

2010-07-10 Thread Bob Proulx
Marnen Laibow-Koser wrote: Rails Learner wrote: I have a controller action that can render the response in pdf format as well as html format. Now, I need to attach a pdf file rendered by the above action to an email on the fly. How can I do this? What is the the best practice?

[Rails] Re: Multi databases in rails 3

2010-07-10 Thread Bob Proulx
trung wrote: Is there any support for multiple databases in Rails 3? Either natively through ActiveRecord or third party gem? I haven't looked at Rails 3 yet but since being able to access multiple databases is a core feature of Rails 1 and Rails 2 I feel confident in saying that if Rails 3

Re: [Rails] how do you pronounce git?? :D

2010-07-10 Thread Colin Law
On 10 July 2010 21:26, David Zhu dzwestwindso...@gmail.com wrote: Hey How do you pronounce git? Is it like jit? or is it more like gghit? I know ryan b pronounces it the second way ;) Not sure how it's supposed to pronounced. I pronounce it the first way. Just wondering. I need some

Re: [Rails] how do you pronounce git?? :D

2010-07-10 Thread Angel Robert Marquez
git out of here. On Sat, Jul 10, 2010 at 1:26 PM, David Zhu dzwestwindso...@gmail.comwrote: Hey How do you pronounce git? Is it like jit? or is it more like gghit? I know ryan b pronounces it the second way ;) Not sure how it's supposed to pronounced. I pronounce it the first way.

Re: [Rails] Re: Routing problem

2010-07-10 Thread Leonardo Mateo
On Sat, Jul 10, 2010 at 3:26 PM, Sijo k g li...@ruby-forum.com wrote: Hi Leonardo Hi Sijo  map.resources :courses, :member = { :confirm = :get}, :collection = { :available = :get } Then I have the users resource, which has many products map.resources :users, :has_many = [:subscriptions,

[Rails] Re: how do you pronounce git?? :D

2010-07-10 Thread Marnen Laibow-Koser
David Zhu wrote: Hey How do you pronounce git? Well, you don't pronounce it Rails, that's for sure. Go ask in a Git forum. Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from my iPhone -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Re: Re: mysql gem migrate Unknown database '[db_development] error

2010-07-10 Thread Sandip Jassar
Jatin kumar wrote: I am not sure of why this error is coming, but just for a moment, try rake db:create before doing rake db:migrate. It might solve your problem. The Mysql::Result constant is defined in the mysql_api gem (.so shared object) - this is located in

Re: [Rails] Re: Additional methods in models - how to access them?

2010-07-10 Thread Colin Law
On 10 July 2010 18:32, Szymon Przybył apocalyp...@gmail.com wrote: This works: pattern.notes.first(:conditions = {:location = location}) But I want use it in views, pattern.notes.get_location(location) looks much better, but how can I make it works? I am not sure what you are trying to do.

Re: [Rails] Re: Rails 3 convert time of created_at before saving to MySQL

2010-07-10 Thread Jeffrey L. Taylor
Did you restart your server? Did you properly migrate config/environment.rb to config/application.rb. I.e., change Rails::Initializer.run do |config| config.time_zone = 'Bangkok' end to: # config/application.rb module YourApplicationName class Application Rails::Application

[Rails] Re: Generate PDF and attach to email on the fly

2010-07-10 Thread Rails Learner
Thanks Everybody! I have figure out myself how to do this. I just passed the binary data of the PDF to the mailer and then create the attachment. Thanks again! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: Re: Additional methods in models - how to access them?

2010-07-10 Thread Kenneth    
class Note ActiveRecord::Base belongs_to :pattern def get_location(location) find(:conditions = [location = ?, location]) end end Should be: class Note ActiveRecord::Base belongs_to :pattern def self.get_location(location) find(:conditions = [location = ?, location]) end

[Rails] Re: Re: Additional methods in models - how to access them?

2010-07-10 Thread Kenneth    
But if you are just doing find(:conditions = [location = ?, location]) there is already a method defined called find_by_location() example: Note.find_by_location(location) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups