[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 window

[Rails] Re: Headache with sessions being shared.

2009-11-01 Thread James West
hange to the app your > sessions would all be invalid, which causes nasty errors that are hard > to decipher. Set the key by hand or via a generator or something when > you create the app then leave it alone. > > > On Nov 1, 3:56�pm, Jam

[Rails] Re: Headache with sessions being shared.

2009-11-01 Thread James West
find_cart_from_session > debugger > if session[:cart] # if there's is a cart in the session > > and take a look at session[:cart]. Is it a blank string, what class is > it, etc. > > > > On Nov 1, 1:09�pm, James West -- Posted via http://www.ruby-forum.com/.

[Rails] Headache with sessions being shared.

2009-11-01 Thread James West
I have a really horrendous problem with sessions. before_filter :find_cart_from_session private def find_cart_from_session if session[:cart] # if there's is a cart in the session begin @cart = Cart.find(session[:cart]) # return existing or new cart rescue ActiveRecord::Re

[Rails] Re: Annoying problem with file_field and paperclip

2009-10-20 Thread James West
Philip Hallstrom wrote: >> Philip Hallstrom wrote: >>> This doesn't sound right at all... I've got many forms using form_for >>> and f.file_field, etc... and this isn't an issue for me. Nothing >>> special I'm doing to prevent it... are you sure you're not setting >>> that field to something some

[Rails] Re: Annoying problem with file_field and paperclip

2009-10-20 Thread James West
Philip Hallstrom wrote: > This doesn't sound right at all... I've got many forms using form_for > and f.file_field, etc... and this isn't an issue for me. Nothing > special I'm doing to prevent it... are you sure you're not setting > that field to something somewhere in a before filter or somethi

[Rails] Annoying problem with file_field and paperclip

2009-10-19 Thread James West
Hi all, I have a really really annoying problem that's driving me nuts with file_field and paperclip and having to upload images everytime a form is edited even though the user is quite happy with the currently uploaded image or loose the previously uploaded image. This seems to be caused by the

[Rails] Re: Looking for a good resource on open-uri and FileUtils

2009-10-04 Thread James West
Matt Jones wrote: > You're probably better off starting by looking at Paperclip's S3 > support, which is logically closer to what you want to do. > > --Matt Jones > > > On Oct 3, 10:15�am, James West Thank you Matt I'm struggling to understand how the rig

[Rails] Looking for a good resource on open-uri and FileUtils

2009-10-03 Thread James West
Hi all, I'm needing to extend the Paperclip Storage module to handle external URL's so that I can upload my doc's/images to an external source rather than the app's local file system. The FileSystem module reads module Filesystem def self.extended base end def exists?(styl

[Rails] Paperclip + asset_host uploading to external URL

2009-10-01 Thread James West
I would need to be able to upload images to an external URL I know S3 is an option but there are better image hosts out there for my requirements and one in particular I would like to make use of. I'm thinking that I could use asset_host to determine the url and path but I can't seem to make Pape

[Rails] Re: cost model for a RoR where users could upload lots of file? what approach?

2009-09-27 Thread James West
the blog) > to handle users browsers picking up images directly from > www.unlimitedwebhosting.co.uk? > > 2009/9/26 James West : >>> � (a) a simple cost model for use of the site, e.g. free up to X but >> Use an external repository for your images that has unlimi

[Rails] Re: cost model for a RoR where users could upload lots of file? what approach?

2009-09-26 Thread James West
Greg Hauptmann wrote: > Hi, > > Any ideas/suggestions re what a good cost model / approach would be if > one's Ruby on Rails application was to be successful, but noting users > (as part of the service/application) could upload lots of files > (images etc). > > What's a good way of have: > (a)

[Rails] Re: Cheapest Rails Hosting where they give you full access to Apache (to load modules etc)???

2009-09-26 Thread James West
Greg Hauptmann wrote: > any pointers / suggestions re cheapest Rails hosting where they give > you full access to Apache (to load modules etc)??? Can be a shared > platform, however not sure if there is a shared platform type hosting > service where they do give you such access? Having tried a l

[Rails] Paperclip with external url and asset_host?

2009-09-26 Thread James West
Hi, I'm trying to get Paperclip to work with asset_host and have totally failed to do so. The idea is to use asset_host to specify the url that I want to use for my image hosting (www.unlimitedwebhosting.co.uk) so that link helpers will use the image host location instead of the local file system

[Rails] Re: Best way to convert path slash for backtick usage?

2009-09-04 Thread James West
> Guessing: >cmd.gsub!(File::SEPARATOR, File::ALT_SEPARATOR) if > File::ALT_SEPARATOR > > > -Rob > > Rob Biedenharnhttp://agileconsultingllc.com > r...@agileconsultingllc.com You absolute star :-) That will do EXACTLY what I need. Thanks so much. James -- Posted via http://www.ruby-f

[Rails] Re: Best way to convert path slash for backtick usage?

2009-09-04 Thread James West
Aldric Giacomoni wrote: > In Windows: >>> Dir.chdir 'c:/myscripts' > => 0 >>> Dir.pwd > => "c:/myscripts" > > I think you're making a mountain out of a molehill. Ruby interprets the > path properly. Keep it to '/' and do input sanitation when the user > tries to give you a '\' > > Yet, I don't

[Rails] Re: Best way to convert path slash for backtick usage?

2009-09-04 Thread James West
Marnen Laibow-Koser wrote: > James West wrote: >> Hi, >> Depenbding on whether running under windows or unix/mac I obviously need >> to use the \ instead of the / character for shell commands so I have 2 >> questions really >> 1) I would love to know if anyo

[Rails] Re: Best way to convert path slash for backtick usage?

2009-09-04 Thread James West
Markus Roberts wrote: >>> Depenbding on whether running under windows or unix/mac I obviously >>> need >>> to use the \ instead of the / character for shell commands so I >>> have 2 >>> questions really >>> 1) I would love to know if anyone has a neat way of dealing with >>> converting paths t

[Rails] Re: Best way to convert path slash for backtick usage?

2009-09-04 Thread James West
James West wrote: > Hi, > Depenbding on whether running under windows or unix/mac I obviously need > to use the \ instead of the / character for shell commands so I have 2 > questions really > 1) I would love to know if anyone has a neat way of dealing with > converting paths

[Rails] Best way to convert path slash for backtick usage?

2009-09-04 Thread James West
Hi, Depenbding on whether running under windows or unix/mac I obviously need to use the \ instead of the / character for shell commands so I have 2 questions really 1) I would love to know if anyone has a neat way of dealing with converting paths to use '\' instead of '/' for use with command line

[Rails] Re: Best approach to providing app congurations?

2009-08-27 Thread James West
Matt Harrison wrote: > > I have no idea if this is the best method by any means, but I have used > it before with no problems: > > I created a model called AppConfig which had an id, a key and a value. I > could set the key to the name of the configuration (such as > "allow_new_signups") and the

[Rails] Best approach to providing app congurations?

2009-08-26 Thread James West
This is more about theory than coding so I hope I have the right place. I would very much appreciate some input as to the best approach on how to offer different options in my app depending on configuration criteria and current user. Some examples of what I want to do I guess would be a help. Fi

[Rails] Re: Does link_to_remote degrade to an HTML request?

2009-08-24 Thread James West
Maurício Linhares wrote: > It will not degrade automatically, you'll have to tell it to do so > adding an :href property: > > link_to_remote "Delete this post", > { :update => "posts", :url => { :action => "destroy", :id => post.id > } }, > :href => url_for(:action => "destroy", :id =>

[Rails] Re: Does link_to_remote degrade to an HTML request?

2009-08-24 Thread James West
David Angga wrote: > just make sure you've include prototype.js. > and enable javascript function on your browser. > > regards. > > On 8/24/09, James West wrote: >> Posted via http://www.ruby-forum.com/. >> >> > >> > > >

[Rails] Does link_to_remote degrade to an HTML request?

2009-08-24 Thread James West
I'm just looking at adding some AJAX to my app and am considering turning some link_to's into link_to_remotes and I could do with knowing if link_to_remote degrades to an HTML request if javascript is not enabled in a users browser? If so, is there anything special I need to do with the link_to_re

[Rails] Re: Ruby on Rails course ... looking for hint and people

2009-08-24 Thread James West
Simone R. wrote: > Hi everybody ... > > I was trying to learn RoR by attending a course ... but right now > there are not enought people so the course probably will not run ... and > for me is a problem because I need Ror for work :- > > If there is someone interested (or if you have some

[Rails] Re: Upgrading to 2.3 from 2.1

2009-08-23 Thread James West
Chris Olsen wrote: > Can be done in a one step process or do I have to upgrade to 2.2 then > 2.3? > > Thanks for the help. After you have updated Rails and set your environment.rb to use the correct version don't forget to run rake update. -- Posted via http://www.ruby-forum.com/. --~--~-

[Rails] Re: tinymce problem

2009-08-23 Thread James West
Ritvvij wrote: > Hi, > > I am using tinymce for giving text editor the editing options. > The problem its giving me is that if I press 1 enter, it actually ends > up with two enters. > > Example: > > In editor I tpye > " > abc > abccc" > > But it ends up as " > abc > > abccc" > > Does any on

[Rails] Best way of moving some jQuery from a view helper

2009-08-23 Thread James West
I have a helper that uses some jQuery code that I would like to move out of the helper method. I am trying to move it to application.js but it will probably end up in a different file. I have two reasons for wanting to do this. 1) I want to keep all my jQuery code seperate to my HTML code 2) I wan

[Rails] Re: Adding products from multiple views in multiple controllers

2009-08-23 Thread James West
Kostas Lps wrote: > Hi guys, > i want to create a cart i my application for ordering books (this will > work only in localhost not in production). Is there any tutorial > explaining how can this be implemented? Or any good plugin with > instructions??? > Thanx in advance > Kostas L. The AWDWR (A

[Rails] Re: How to freeze v 2.3.2?

2009-08-22 Thread James West
Colin Law wrote: > 2009/8/22 James West : >> >> It does use 2.3.2 locally but I need to freeze this in for deployment. >> Maybe I could uninstall 2.3.3 somehow then it would revert back to using >> 2.3.2 on a gems freeze? >> I dunno, I'm clutching at straws

[Rails] Re: How to freeze v 2.3.2?

2009-08-22 Thread James West
Colin Law wrote: > If you have the line in environment.rb then it should use 2.3.2 > without having to freeze it in. Delete any rails directory in / > vendor in your application and try the app. If it is not using 2.3.2 > there is something odd going on. Are you sure there is not a typo in > t

[Rails] Re: How to freeze v 2.3.2?

2009-08-21 Thread James West
Colin Law wrote: > > I am not sure but here is a suggestion. First lock your application to > 2.3.2 by putting this at the beginning of environment.rb (watch out in > case there is already a line setting this up) > > RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION > > Check the

[Rails] Re: How to freeze v 2.3.2?

2009-08-21 Thread James West
Tnis is till plaguing me. Does anyone have any ideas at all? -- 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, send email t

[Rails] Re: Best InPace editing plugin / method

2009-08-20 Thread James West
Michael Moulsdale wrote: > I'm wanting to add some InPlace editing code to my application and > have seen a number of methods to do this. > > I therefore wanted to get a gauge on what this group thinks is the > best approach for the latest version of ruby and rails? > > Michael You need to elab

[Rails] Re: How to freeze v 2.3.2?

2009-08-20 Thread James West
Conrad Taylor wrote: > On Thu, Aug 20, 2009 at 3:24 AM, James West < > rails-mailing-l...@andreas-s.net> wrote: > >> >> I don't understand why the freeze:edge is failing. > > > What platform are you on and what you're typing at the command prompt?

[Rails] Re: How to freeze v 2.3.2?

2009-08-20 Thread James West
Wap Addon wrote: > follow this site instruction and do that way > > http://arjunghosh.wordpress.com/2008/04/18/how-to-freeze-rails-application/ Thanks for the reply. I think I'm missing something. I can't see how that is telling me to do anything different to the way's I'm trying. I don't unde

[Rails] How to freeze v 2.3.2?

2009-08-19 Thread James West
My app doesn't like 2.3.3 mainly due to a known bug in Rails that will be fixed in 2.3.4 I had 2.3.2 frozen until I downloaded and tested 2.3.3 Now I want to freeze 2.3.2 back into my app but rake rails:freeze:gems insists on unpacking 2.3.3 and an edge freeze for the 2.3.2 version fails C:\De

[Rails] Re: How to get current time including milliseconds for div id?

2009-08-19 Thread James West
Marnen Laibow-Koser wrote: > On Aug 19, 1:07�pm, James West > wrote: > [...] > > Or you could just increment a counter as you create fields, so that > you have a serial number to put in your id attributes. > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org

[Rails] Re: How to get current time including milliseconds for div id?

2009-08-19 Thread James West
Marnen Laibow-Koser wrote: > On Aug 19, 1:07�pm, James West > wrote: > [...] > > Or you could just increment a counter as you create fields, so that > you have a serial number to put in your id attributes. > Now that has possibilities. I don't know why I didn&

[Rails] Re: How to get current time including milliseconds for div id?

2009-08-19 Thread James West
Marnen Laibow-Koser wrote: > James West wrote: >> I need to auto generate a guaranteed to be unique number or string to be >> used something like this in a partial view > > > First of all: what's the purpose of this? Why do you need all these > unique IDs? I

[Rails] Re: How to get current time including milliseconds for div

2009-08-19 Thread James West
Gleb Mazovetskiy wrote: > This certainly looks like an incorrect approach to the problem. > Could you, please, elaborate on this? That wouldn't surprise me at all. lol! It's quite a complicated scenario and I was trying to keep this simple. Here goes. I'm working on a multi model form solution

[Rails] Re: How to get current time including milliseconds for div id?

2009-08-19 Thread James West
James West wrote: > Rick Lloyd wrote: >> You want to use Time.now.to_f if you're worried about more than one >> hit per second. >> >> >> On Aug 19, 11:44�am, Maur�cio Linhares > > Thank you for the fast res

[Rails] Re: How to get current time including milliseconds for div id?

2009-08-19 Thread James West
Rick Lloyd wrote: > You want to use Time.now.to_f if you're worried about more than one > hit per second. > > > On Aug 19, 11:44�am, Maur�cio Linhares Thank you for the fast response Time.now.to_f gives me the following My partial looks like this <%tnow = Time.now.to_f%> <%-lis

[Rails] How to get current time including milliseconds for div id?

2009-08-19 Thread James West
I need to auto generate a guaranteed to be unique number or string to be used something like this in a partial view > I thought of using time.now but that only goes to seconds. I have tried rand(time.now) but that does not guarantee a nique ID. There would be more than one partial created within

[Rails] Re: Best way to copy a table using ActiveRecord

2009-08-10 Thread James West
Seriously, The best way to ahieve this is in a stored procedure in the database. Just create a method on your model class that will run the stored proc, that way your controllers and rake tasks etc... can have access to the functionality if you want them to . Let the database do the job it's de

[Rails] Re: Open source rails 2 books

2009-08-08 Thread James West
Marnen Laibow-Koser wrote: > James West wrote: >> Marnen Laibow-Koser wrote: >> >>> Why is it a no-brainer? It's not like the money goes to support the >>> Rails core team. >> >> AWDWR is recommended reading on the Rails website. > [...]

[Rails] Re: How do I report a Rails bug?

2009-08-08 Thread James West
Rocco Di Leo wrote: > https://rails.lighthouseapp.com/dashboard > > On Sat, Aug 8, 2009 at 4:58 PM, James West > http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Rub

[Rails] Re: has_many :through, multi model form unable to save new child

2009-08-08 Thread James West
OK this is a Rails bug. I have done extensive testing now and am able to prove that the code works on a has many but has_many :through fails. I'll report it as a bug if someone can tell me how? Thanks James -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---

[Rails] Re: Open source rails 2 books

2009-08-08 Thread James West
Marnen Laibow-Koser wrote: > Why is it a no-brainer? It's not like the money goes to support the > Rails core team. AWDWR is recommended reading on the Rails website. Quote from the publishers The Pragmatic Bookshelf Sam Ruby is a prominent software developer who has made significant contri

[Rails] Re: ActiveRecord - <%= and <% yielding different records

2009-08-08 Thread James West
bill walton wrote: > Hi Colin, > > On Fri, 2009-08-07 at 20:39 +0100, Colin Law wrote: > >> All of the above suggestions may be valid, however it does not explain >> how, once the OP has managed by fair means or foul to get hold of the >> member object that it manages to mutate between his two u

[Rails] Re: Open source rails 2 books

2009-08-08 Thread James West
Marnen Laibow-Koser wrote: > James West wrote: > [...] >> Go and buy the pdf AWDWR >> http://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition > > I suspect the OP knows about AWDWR -- he was looking for open-source > books. > >>

[Rails] How do I report a Rails bug?

2009-08-08 Thread James West
Just as the title sais really. How should I go about reporting a bug in Rails 2.3.2 and 2.3.3? Thanks James -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Re: Question on the latest rails book

2009-08-08 Thread James West
For what it's worth I am witrh Colin on this but this is covered in the foot note on page 46 of the pdf 6. If instead you see a message to the effect of No route matches "/say/hello", try stopping and restarting your server, because something you have done caused Rails to cache your configurat

[Rails] Re: Open source rails 2 books

2009-08-08 Thread James West
Fla As wrote: > Hello, > where can I find open source rails 2 books? > > Thank you in advance. > > Cheers, Go and buy the pdf AWDWR http://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition Your software has cost you nothing, putting your hand in your pocket to find

[Rails] Re: Doubt retrieving data?

2009-08-08 Thread James West
Karthik Kantharaj wrote: #> *how can i access the contract_id which is in another table* :contract_id=>"#...@contract.id}" -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "R

[Rails] Re: Best Practices Question

2009-08-08 Thread James West
pharrington wrote: > On Aug 7, 11:54�pm, Phlip wrote: >> Views should be dumb, Controllers thin, and Models fat. >> >> If the deliver_ call were one line, it qualifies for the Controller. But... >> >> The delivered template is itself a View. Hence it should be dumb. Hence >> anything >> powering

[Rails] Re: Scaffolding in a sub-directory on Rails 2.x

2009-08-07 Thread James West
Sijo Kg wrote: > Hi > >Not only doing the above solves all..You have to edit a lot of > places. Rather than I explain all these and grab a lot more spaces here > you better read this > Read section Namespaced Routes in > > http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the

[Rails] Re: has_many :through, multi model form unable to save new child

2009-08-07 Thread James West
James West wrote: > James West wrote: > Sorry, I ommited to post the actual error which is now > > Cannot modify association 'User#addresses' because the source reflection > class 'Address' is associated to 'UserRole' via :has_many. Further investi

[Rails] Re: RichTextEditor

2009-08-07 Thread James West
Ritvvij wrote: > Hi, > > Which is the most advisable Rich Text Editor plugin / gem to use? > > Please advise I really liked tinymce, simple to use, lightweight and easy to implement but I couldn't get an image upload to work with it. I ended up installing and trying about 6 others until I fin

[Rails] Re: has_many :through, multi model form unable to save new child

2009-08-07 Thread James West
James West wrote: Sorry, I ommited to post the actual error which is now Cannot modify association 'User#addresses' because the source reflection class 'Address' is associated to 'UserRole' via :has_many. -- Posted

[Rails] Re: has_many :through, multi model form unable to save new child

2009-08-07 Thread James West
Ilan Berci wrote: > James West wrote: >> Further testing shows that if I use a hidden contact_id field in the >> address form the contact_id gets passed to the params hash as I would >> expect but I still get the >> > > > You either have to chan

[Rails] Re: has_many :through, multi model form unable to save new child

2009-08-07 Thread James West
Further testing shows that if I use a hidden contact_id field in the address form the contact_id gets passed to the params hash as I would expect but I still get the Cannot modify association 'User#administrator_addresses' because the source reflection class 'Address' is associated to 'Administ

[Rails] Re: Strange View Problem

2009-08-06 Thread James West
firebug is your friend. As colin suggested, viewing the source code in your browser will give you a clue as to what is happening. If you use firebug (plugin for firefox) to inspect element you will see all the css, layout and source code, you can even edit the soirce code as you look at it and

[Rails] has_many :through, multi model form unable to save new child

2009-08-06 Thread James West
I am totally unable to create a new child in a has_many :through multi model form using nested_attributes for an existing grandparent. Sorry, that sounds quite a mouth full. Basically I am editing an existing user that has many administrator_addresses through an administrator association. If I c

[Rails] Re: Best place to host ROR website

2009-08-06 Thread James West
+1 for rails playground. Totally proffesional rails gurus, live chat available manned by rails techies 24/7, uber helpfull and totally competetive pricing. Sometime a little too helpfull, I struggled with writing my first deploy.rb script and asked them in live chat bout what to do and they wr