[Rails] Is ActioveResource suitable for use eBay/PayPal api's?

2010-02-14 Thread James West
I've been having a play with eBay and PayPal API calls and am happily getting xml responses using Net::HTTP calls but now I'm wondering if I can use ActiveResource instead. I've created a very basic ActiveResource class that has self.site set to a full url that returns xml data in a browser

Re: [Rails] [JOBS] Remote assistance requested for RoR setup.

2010-02-14 Thread Lasse Bunk
Why not use Robby Russells walkthrough: http://www.robbyonrails.com/articles/2010/02/08/installing-ruby-on-rails-passenger-postgresql-mysql-oh-my-zsh-on-snow-leopard-fourth-edition? He does a great job, and when you're done, you have all you need. :-) Lasse 2010/2/13 john h johnhoec...@gmail.com

Re: [Rails] Bundler ignores :group = :production?

2010-02-14 Thread Lasse Bunk
At my dev box it doesn't listen to the group parameter either. Just to let you know that it isn't just your box – maybe something in Rails 3? 2010/2/13 Steve Rowley srow...@gmail.com I'm using SQLite on my dev box and MySQL in production. I'm also running an old mysql adapter gem in production

[Rails] Re: Checkbox - hide/show element

2010-02-14 Thread ayupmeduck
That's fine, but Rails normally includes the prototype libs, so you could have done it in one line: :onclick = ELEMENT_NAME.hide();return false On Feb 13, 12:24 pm, Patrick G. li...@ruby-forum.com wrote: I don't like self-answered posts... I've found a solution. I have created a simple

[Rails] undefined method `camelize' for app:String

2010-02-14 Thread Ian Vaughan
Hi, trying to use rails to create an app, and get the following error message :- $ rails testapp undefined method `camelize' for app:String I have the following setup/versions :- * Windows 7 * Cygwin - GNU bash, version 3.2.49(23)-release (i686-pc-cygwin) Versions via Cygwin :- * ruby

[Rails] Re: sharing a method, model, module or ???

2010-02-14 Thread Frederick Cheung
On Feb 14, 6:56 am, Craig White craigwh...@azapple.com wrote: %= Picture.some_method % I am still up a creek without a paddle this works but clearly doesn't belong in a view... % @pic_1 = Picture.find(:first, :conditions = [active = true], :order = 'view_count'); @pic_1.view_count += 1;

[Rails] forcing lower case in form helper label

2010-02-14 Thread Ralph Shnelvar
f.label 'something' produces Something instead of something How can I force f.label to have a lower case initial letter? -- 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

[Rails] Re: how do I get all records whose count of associations is above a certain number

2010-02-14 Thread Frederick Cheung
On Feb 14, 6:54 am, Frank Kim railso...@gmail.com wrote: I have a model, let's call it Player. It has many Trophies. How do I do a simple query in Rails in my controller that will return let's say all Players that have more than 5 tropies? Sorry for the dumb question but I can't figure

Re: [Rails] Is ActioveResource suitable for use eBay/PayPal api's?

2010-02-14 Thread Lasse Bunk
From this page: http://www.therailsway.com/2007/9/3/using-activeresource-to-consume-web-services 1. The service must understand Rails-style REST URLs. (e.g. “POST /credit_cards.xml” to create a credit card, etc.) 2. The service must respond with a single XML-serialized object

Re: [Rails] Re: how do I get all records whose count of associations is above a certain number

2010-02-14 Thread Frank Kim
Thanks everyone, that was really helpful! On Sun, Feb 14, 2010 at 4:31 AM, Frederick Cheung frederick.che...@gmail.com wrote: On Feb 14, 6:54 am, Frank Kim railso...@gmail.com wrote: I have a model, let's call it Player. It has many Trophies. How do I do a simple query in Rails in my

[Rails] Re: Sending XML requests

2010-02-14 Thread Ben Wiseley
tashfeen.ekram wrote: What about ordinary SOAP requests? Is Net::HTTP the way to go for that? Take a look at ActiveMerchant's code; specifically the commit method in the module

Re: [Rails] sharing a method, model, module or ???

2010-02-14 Thread Lasse Bunk
It depends on what you want the method to do. Inside the Picture class, this should work: class Picture ActiveRecord::Base # ... def self.get_most_viewed_picture pic = Picture.find(:first, :conditions = [active = ?, true], :order = 'view_count DESC') pic.increment! :view_count

Re: [Rails] forcing lower case in form helper label

2010-02-14 Thread Lasse Bunk
f.label :something, something :-) Lasse 2010/2/14 Ralph Shnelvar li...@ruby-forum.com f.label 'something' produces Something instead of something How can I force f.label to have a lower case initial letter? -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: forcing lower case in form helper label

2010-02-14 Thread Ralph Shnelvar
Lasse Bunk wrote: f.label :something, something :-) Lasse 2010/2/14 Ralph Shnelvar li...@ruby-forum.com Well ... that certainly was simple but then what is the purpose of the first parameter? What are the downsides to f.label '', something ? -- Posted via

Re: [Rails] Re: forcing lower case in form helper label

2010-02-14 Thread Lasse Bunk
Yeah it's pretty simple :-) The purpose of the first parameter is to provide an ID for the label and optionally a default text for the label. This is used if you don't provide a second parameter. Check out http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001604 and

[Rails] Re: forcing lower case in form helper label

2010-02-14 Thread Ralph Shnelvar
Ralph Shnelvar wrote: Lasse Bunk wrote: f.label :something, something :-) Lasse 2010/2/14 Ralph Shnelvar li...@ruby-forum.com Well ... that certainly was simple but then what is the purpose of the first parameter? What are the downsides to f.label '', something ? OK ... I

Re: [Rails] Re: forcing lower case in form helper label

2010-02-14 Thread Lasse Bunk
Super – glad you found out :-) Lasse 2010/2/14 Ralph Shnelvar li...@ruby-forum.com Ralph Shnelvar wrote: Lasse Bunk wrote: f.label :something, something :-) Lasse 2010/2/14 Ralph Shnelvar li...@ruby-forum.com Well ... that certainly was simple but then what is the purpose

[Rails] Can't mass-assign these protected attributes: tag_attributes

2010-02-14 Thread Greg Ma
Hi, I added a textarea to my edit student form, to be able to add tags to this student. I did the simple code below, and this is the error i get. I can't see what i did wrong... #Error message Processing StudentsController#update (for 127.0.0.1 at 2010-02-14 10:13:22) [PUT] Parameters:

[Rails] Re: UJS in Rails 3 Beta

2010-02-14 Thread overture
The underlying meaning of this statement is; Rails as a framework use to favour a certain Javascript framework (Prototype). This doesn't mean that you alone would need to write your own solution for JQuery, but someone, somewhere *did* have to write JRails. Likewise, if you wanted to use

Re: [Rails] Can't mass-assign these protected attributes: tag_attributes

2010-02-14 Thread Lasse Bunk
I think you need to add :tag_attributes to attr_accessible in your model – would this fix the problem? Lasse 2010/2/14 Greg Ma li...@ruby-forum.com Hi, I added a textarea to my edit student form, to be able to add tags to this student. I did the simple code below, and this is the error i

Re: [Rails] Can't mass-assign these protected attributes: tag_attributes

2010-02-14 Thread Rob Biedenharn
On Feb 14, 2010, at 1:29 PM, Greg Ma wrote: Hi, I added a textarea to my edit student form, to be able to add tags to this student. I did the simple code below, and this is the error i get. I can't see what i did wrong... #Error message Processing StudentsController#update (for 127.0.0.1

[Rails] Re: Can't mass-assign these protected attributes: tag_attributes

2010-02-14 Thread Greg Ma
Lasse Bunk wrote: I think you need to add :tag_attributes to attr_accessible in your model – would this fix the problem? Lasse 2010/2/14 Greg Ma li...@ruby-forum.com it works! Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to

[Rails] how to describe negative find condition in has_many

2010-02-14 Thread cpr
I have a Teams that has_many Players. I need to get the list of Teams that have no active players (whether they have 0 players or they have a lot of players all of whom are non- active). Can't figure out the conditions for doing this other than subtracting the ones with active players from the

Re: [Rails] how to describe negative find condition in has_many

2010-02-14 Thread Lasse Bunk
Try: named_scope :without_active_players, :conditions = NOT EXISTS(SELECT * FROM players WHERE team_id=teams.id AND status='active'), :order = name Does this work? Lasse 2010/2/14 cpr crosebr...@gmail.com I have a Teams that has_many Players. I need to get the list of Teams that have no

[Rails] nicEdti image upload plugin

2010-02-14 Thread udalov.ser...@gmail.com
Hi everyone! Please, try out my plugin for image upload with nicEdit. http://github.com/sergio-fry/Simple-nicEdit. Reply to : http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/3bc17b66993c7375 -- You received this message because you are subscribed to the Google Groups Ruby

Re: [Rails] sharing a method, model, module or ???

2010-02-14 Thread Craig White
On Sun, 2010-02-14 at 17:06 +0100, Lasse Bunk wrote: It depends on what you want the method to do. Inside the Picture class, this should work: class Picture ActiveRecord::Base # ... def self.get_most_viewed_picture pic = Picture.find(:first, :conditions = [active = ?, true],

[Rails] Re: how to describe negative find condition in has_many

2010-02-14 Thread cpr
He shoots. He scores! Thanks much for the insight. -Chris On Feb 14, 12:15 pm, Lasse Bunk lasseb...@gmail.com wrote: Try: named_scope :without_active_players, :conditions = NOT EXISTS(SELECT * FROM players WHERE team_id=teams.id AND status='active'), :order = name Does this work? Lasse

[Rails] Re: Activeresource and pagination.

2010-02-14 Thread Sidu ponnappa Chonira
hart...@gmail.com wrote: Hi, I am fairly new to rails and am trying to figure out the right way to do pagination with ActiveResource. I am considering just wrapping will_paginate over everything but I before I do I was hoping to get some input from some more experienced developers.

[Rails] Verify presence_of parameter

2010-02-14 Thread Sean Six
I would like to verify a parameter is present before a search is posted. min_age = params[:min_age] max_age = params[:max_age] @users = User.find(:all, :conditions = [years = ? AND years = ? min_age, max_age]) Basically I am just concerned about the max_age. I tried this:

[Rails] moved from ruby 1.8.6 to 1.8.7 and We're sorry, but something went wrong.

2010-02-14 Thread AlwaysCharging
I'm a windows user, and I was using ruby 1.8.6 installer over at RubyInstaller.org. All was working well, but I decided to give ruby 1.8.7 a try. I uninstalled 1.8.6, downloaded and installed ruby 1.8.7 from rubyinstaller, reinstalled rails and all of my gems, and copied over sqlite3.def and

[Rails] Re: moved from ruby 1.8.6 to 1.8.7 and We're sorry, but something went wrong.

2010-02-14 Thread AlwaysCharging
Nevermind. I'm an idiot. I forgot to install the actual sqlite3 GEM. gem install sqlite3-ruby --source http://gems.rubyinstaller.org Problem solved, and sorry to waste a post. On Feb 15, 12:03 am, AlwaysCharging goodg...@gmail.com wrote: I'm a windows user, and I was using ruby 1.8.6 installer

[Rails] HELP ON HTML CONTENT MODIFICATION

2010-02-14 Thread Newb Newb
Dear all, i have a html file in my local path. In that html file i have below tag. img src=/2010-01-12/Capture/1210420100112145725141.jpg / Now what i need is i want to modify the above tag into img src=/Capture/1210420100112145725141.jpg / i want to replace all the image path like above

[Rails] making a new project, should I choose rails 2.3.5 or 3.0 .0 beta?

2010-02-14 Thread princezuda
hey, I am making a new project, and I've been having trouble deciding between rails and 3.5 and rails 3.0.0 beta one. I realize that rails 3.0.0 should be out of beta sometime mid-summer, which is around the time I expect to launch a project. I try to think ahead, and in many ways it makes sense

[Rails] Re: how do I get all records whose count of associations is above a certain number

2010-02-14 Thread Peter
And you can actually represent this in AR friendly syntax; no console in front of me but its something like Player.find(:select = players.id, :joins = :trophies, :group = 'players.id', :having = 'count(players.id) 5') Downside of this is that the returned objects in this case would only have ID

Re: [Rails] making a new project, should I choose rails 2.3.5 or 3.0 .0 beta?

2010-02-14 Thread Conrad Taylor
On Sun, Feb 14, 2010 at 10:43 PM, princezuda kingz...@gmail.com wrote: hey, I am making a new project, and I've been having trouble deciding between rails and 3.5 and rails 3.0.0 beta one. I realize that rails 3.0.0 should be out of beta sometime mid-summer, which is around the time I

[Rails] Problem with internationalization

2010-02-14 Thread Ralph Shnelvar
I have I18n working. I translated my en.yml file to German (de.yml) and hae set DE as the default language in environment.rb. Everything is almost working. My problem is that I am getting this � char ... instead of this ä on the screen displays. I have set meta http-equiv=Content-Type