[Rails] Re: Rails3: ajax responds with js template text!

2010-09-30 Thread Parker Selbert
Naif Dalbahi wrote: > I am so angry that the extension change was never mentioned in rails 3 > documentation site... how are people supposed to know about that if the > development team doesn't announce that?! This isn't a new change at all, and especially not specific to Rails 3. The code you

[Rails] Re: Rails 3 with Mongrel possible?

2010-09-16 Thread Parker Selbert
Greg Willits wrote: > Is mongrel even being maintained anymore? Not exactly. But Mongrel 2 is coming along: http://mongrel2.org/home Alternatively, if you don't want Passenger running locally or don't like it try: Unicorn is pure Ruby and works perfectly with Rails3 - http://github.com/defunkt

[Rails] Re: script/console on production server

2010-09-16 Thread Parker Selbert
Fritz Trapper wrote: > > the very first 'require "readline"' in completion.rb fails. > script/console on my development machine works well. > > Any idea, how to fix this? This happens often in linux (Ubuntu in particular) builds. Essentially you need to install libreadline5-dev and then re-insta

[Rails] Re: storing a file download in a temp file

2010-09-15 Thread Parker Selbert
Kad Kerforn wrote: > If the above link is a URI representing the file ... no, it's a > request to anotherdomain.com for getting the resource with ID 579633 > > when I use this url in a browser : "http://www.anotherdomain.com/ > resource/download/579633" > then the file (a pdf file in this case) i

[Rails] Re: Overriding object instantiation?

2010-09-14 Thread Parker Selbert
moonshadow wrote: > def self.new > gender_class = self.gender == 'Female' ? 'Female' : 'Male' > eval(gender_class).new > end Really, look into how ActiveRecord handles STI by using the type column. It will handle all of this for you. That said, the way to do something when an object is creat

[Rails] Re: storing a file download in a temp file

2010-09-14 Thread Parker Selbert
Kad Kerforn wrote: > In my app, I have an URL to download a file from a remote site , when > using this URL in a browser I download the file... > > "http://www.anotherdomain.com/resource/download/579633"; > > but I need to to get the content of this file within my app , as I > must encode it and

[Rails] Re: Triggering Javascript from a Ruby form

2010-09-06 Thread Parker Selbert
pepe wrote: > I think one of the things you might need is a 'timer', which will let > your code 'sleep' before calling again your 'how_finished' function. I > have never done this but remember reading about it, I googled for > 'javascript sleep timer' and one of the links I found was this: > http:/

[Rails] Re: Triggering Javascript from a Ruby form

2010-09-05 Thread Parker Selbert
A. Leek wrote: > I'm pretty sure I have all the information I need in the program, the > problem is getting it all together and I'm not sure if that's even > possible. Does anyone have ideas? It may be too narrowly supported for what your trying, but you can go to the HTML5 route. Check out the F

[Rails] Re: installing a fork of a gem from github?

2010-09-05 Thread Parker Selbert
Jeremy McAnally wrote: > Prepend the username. So in this case: > >gem install skippy-ec2onrails > > And make sure gems.github.com is a source. In the past I've pulled down the source, built the gem, installed it and then unpacked it to vendor/gems. I like this solution *a lot* more. Grea

[Rails] Re: Failed to build gem native extension.

2010-08-31 Thread Parker Selbert
omar wrote: > I have this same problem with devise1.1, I looked for devise-mswin32 > but could not find? Please help me > cheers > Omar I doubt you'll be able to find pre-compiled binaries for every gem you want to use. If you want to keep developing on Windows, and I'll spare you the commentary

[Rails] Re: Magic method names

2010-08-31 Thread Parker Selbert
Fritz Trapper wrote: > Robert Walker wrote: >> If you just want to see what routes you have defined. > > No, I want to know, which parameters and options are acceptet. The link that Robert posted explains your question exactly. A *tiny* part of that page: 3.3 URLs and Paths Creating a RESTful r

[Rails] Re: Rails 3 - the most annoying deprecation warning

2010-08-31 Thread Parker Selbert
Bharat Ruparel wrote: > Thank you for your time. This makes sense. However, there is not a > single place in my application where I am calling save(false) and this > warning is triggered all over the place WITHOUT a reference to the line > of code (in the plugin/gem) that might be triggering i

[Rails] Re: Rails 3 - the most annoying deprecation warning

2010-08-29 Thread Parker Selbert
Parker Selbert wrote: > (ActiveRecord::Persistence) > save(options) > Saves the model. > > If the model is new a record gets created in the database, otherwise the > existing record gets updated. > By default, save always run validations. If any of them fail the action &g

[Rails] Re: Rails 3 - the most annoying deprecation warning

2010-08-29 Thread Parker Selbert
> DEPRECATION WARNING: save(false) is deprecated, please give > save(:validate => false) instead. (called from save at > /home/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc2/lib/active_record/validations.rb:43) >From the 2.3.8 Docs: (ActiveRecord::Base) save(perform_validation = tru

[Rails] Re: Newbie Qs - Authentication Plugin that supports Instances? Also, Rails 2.3 or 3 for Beginners?

2010-08-29 Thread Parker Selbert
nobosh wrote: > @Peter, thanks for the reply, very helpful. > > #1 - I'm going to go with Devise, I found a railscasts video that > should make installing it easy Devise is great. Clearance works well also, though it has fewer options. Clearance is email based by default, you would have to add u

[Rails] Re: Updating to Rails 3 on Mac OS X

2010-08-29 Thread Parker Selbert
nobosh wrote: > Update 3, after getting all the dependencies installed, it's still > erroring: > > sudo gem install rails --pre > Successfully installed rails-3.0.0.rc2 > 1 gem installed > Installing ri documentation for rails-3.0.0.rc2... > File not found: lib > > Ideas? It looks like it actual

[Rails] Re: Paperclip - Amazon S3 - https

2010-08-21 Thread Parker Selbert
Sandy wrote: > My specific need is to upload the file from one web page, while > allowing a user (who has logged into the site) to then (for a limited > amount of time) to access that page using https and a link on a page > served to that user. > > Does anyone have good tutorial or example code wh

[Rails] Re: Cleanly handling sub-generatede files with Paperclip

2010-08-21 Thread Parker Selbert
Fernando Perez wrote: > Interesting approach. In particular problem you ran into in practice? > Too many files for the fs? Database blowing up? Other? It has worked really well in practice. The failing point was always ImageMagick, really. We ended up using pdf2image instead, which yielded much

[Rails] Re: Cleanly handling sub-generatede files with Paperclip

2010-08-21 Thread Parker Selbert
Fernando Perez wrote: > Hi, > > Let's say I upload a pdf file. Imagemagick extracts all pages out of it > and stores the png images on the hard-drive. How to easily handle all > these generated files with Paperclip? > > Has anyone done that before? Thanks for your advice I've done precisely this

[Rails] Re: Routes ordering

2010-08-20 Thread Parker Selbert
Abder-Rahman Ali wrote: > In the "Head First Rails" book, it mentions this ordering in routes.rb: > > ActionController: : Routing: : Routes. draw do | map| >map. connect ' /ads/new' , : controller=>' ads' , : action=>' new' >map. connect ' /ads/create' , : controller=>' ads' , : action=>'

[Rails] Re: CSV with fastercsv

2010-08-20 Thread Parker Selbert
Tim Shaffer wrote: > This isn't a Rails question. > > But, can't you just put the double quotes insides single quotes? > > csv << [45678, 45678, '"stringa"'] Seconded, this is a Ruby question. Single quotes will work perfectly. You could also use %Q csv << [45678, 45678, %Q{stringa}] -- Poste

[Rails] Re: Re: error_messages_for doesn't work

2010-08-19 Thread Parker Selbert
Bla ... wrote: > I try to put in quotes, but it also doesn't works... Can you paste the content that it renders? Also, does anything scroll by in your server window when you try this? Additionally, wanted to mention that error_messages_for was removed from Rails 3, though available as a plugin.

[Rails] Re: Test unit results display for every rake task

2010-08-19 Thread Parker Selbert
Stewart wrote: > I have not noticed this before but its a little strage. Every time I > run a rake task the results of a test suite are displayed. EG > > Does anyone have any idea why each rake task is loading test::unit ? > Not a biggie but just had me a bit puzzled. When you start your console

[Rails] Re: How to upgrade Rails version that comes with OS X SL

2010-08-18 Thread Parker Selbert
Marnen Laibow-Koser wrote: > > What's the advantage of not using sudo for gems? And for Rails 2.x, why > would you want anything past 1.8.7? Aside from the security aspect, which isn't something I'm concerned about in this context, there is just the simplification. Getting identical, portable

[Rails] Re: How to upgrade Rails version that comes with OS X SL

2010-08-18 Thread Parker Selbert
Hussein B wrote: > Hey, > I have Rails 2.2.2 installed by default on Mac OS X 10.6 > How to upgrade it to the latest Rails 2.x.x ? > Thanks for help and time. You can update to the latest version of rails, but I would very highly recommend install RVM (Ruby Version Manager) as well. It will let y

[Rails] Re: Paperclip generating crap urls on server, works on dev

2010-08-14 Thread Parker Selbert
Nice, thanks for sharing! -- 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 to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to ru

[Rails] Re: Re: what's with the snowman?

2010-08-11 Thread Parker Selbert
Philip Hallstrom wrote: >> http://railssnowman.info/ > Interesting. Maybe the wrong place to ask this, but... > > Why doesn't Rails strip _snowman out of params automagically so I don't > have to worry about it? As of tonight the snowman is gone entirely. The key is "utf8" and the value is ✓ (

[Rails] Re: Paperclip generating crap urls on server, works on dev

2010-08-11 Thread Parker Selbert
Fernando Perez wrote: > Okay so it has to do with caching. On my dev machine, if I switch to > production environment I get the same behavior. I don't know what's the > solution. You're encountering this because Paperclip was originally built to process a file into different sizes of itself, or

[Rails] Re: Paperclip Trouble - Not Writing to the Database

2010-08-11 Thread Parker Selbert
A. Leek wrote: > Well I tried that, and it comes back false... The error messages give > the right path for ImageMagick, but they still fail on the identify > command. I've tested "identify" from the command line, and it works > fine. I'm pretty lost as to what to do now, Paperclip seems to > u

[Rails] Re: Paperclip, id partition, and renaming images

2010-08-10 Thread Parker Selbert
Jeremy Woertink wrote: > So some of my images look like > > thumb.jpg, small.jpg, large.jpg > > and some look like > > thumb_23432S.jpg, small_643563456.jpg, large_2123425F.jpg > > I want them all to look like the first set, so this would take care of > that problem? So there is a mixture of

[Rails] Re: Paperclip, id partition, and renaming images

2010-08-10 Thread Parker Selbert
Jeremy Woertink wrote: > but now I have about 10,000 images that are named wrong and not showing. > I know there is a reprocess! method in paperclip, but it doesn't seem to > rename the images. Is there already a rake task, or something that will > do this? > > Essentially, I would like to do > >

[Rails] Re: Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Parker Selbert
Michael Schuerig wrote: > Capistrano already writes a REVISION file containing the commit sha1. > Let's assume there's a TAG file, too. Then an initializer like this > would do the job > > if Rails.env.production? > version = File.read('TAG').strip > else > version = `git describe --tags --alw

[Rails] Re: Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Parker Selbert
Michael Schuerig wrote: >> I don't see where security would be an issue here, but reusability >> may be. A more generic "VERSION" file that can be loaded and read >> from would be available anywhere in your application, and could be >> simpler to maintain. You could do it as a plaintext file that j

[Rails] Re: Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Parker Selbert
Michael Schuerig wrote: > I'd like to be able to see from generated pages which version of the app > has generated it. As we're using git and always deploy a specific tag, > having that tag in the HTML head as a meta tag would be suitable. > > My current idea goes like this. The layout includes a

[Rails] Re: Paperclip Trouble - Not Writing to the Database

2010-08-09 Thread Parker Selbert
A. Leek wrote: > > I poked around and it seemed to be a problem with ImageMagick, which I > didn't have installed. I installed it and checked that the PATH was > right, but it keeps giving the the same error. Looking around, I tried > the solution here: > http://snipplr.com/view/29445/getting-