[Rails] Re: Where to put large application controller code

2010-02-08 Thread Aleksey Gureiev
Hi Martin, That's a pretty common situation that you describe. One way, which is adopted by Rails team is to factor your related methods in modules and include them in your controllers. You can put those modules near your controllers or under /lib (which is loaded automatically). But before

[Rails] Re: Parallel Payment Conflict Resolution in Paypal

2010-02-08 Thread Ritchie
Saurabh, That doesn't seem to have anything at all to do with Ruby or Rails. Why don't you direct your query to the PayPal forums at http://x.com? /Ritchie On Feb 8, 3:15 pm, Saurabh Peshkar li...@ruby-forum.com wrote: I want to use the paypal adaptive parallel payment API with ROR, please

[Rails] Re: Where to put large application controller code

2010-02-08 Thread Aleksey Gureiev
I'm sorry, looked at the wrong page and didn't notice the ongoing discussion. As you could see, I second that you don't need fat controllers and that CSV processing logic belongs to a CSVProcessor model (not module). It doesn't have a table, but it is a standalone entity that knows how to work

[Rails] Re: Where to put large application controller code

2010-02-08 Thread Martin Berli
Aleksey Gureiev wrote: I'm sorry, looked at the wrong page and didn't notice the ongoing discussion. As you could see, I second that you don't need fat controllers and that CSV processing logic belongs to a CSVProcessor model (not module). It doesn't have a table, but it is a standalone

[Rails] Controller methods over instance variables?

2010-02-08 Thread Andrew France
Hi, I was thinking whether it would be more elegant for a view to call methods on the controller rather than rely on instance variables. I'm not really sure what the answer is so thought I would throw it out here. Perhaps with a basic DSL that makes it explicit what the controller is setting,

[Rails] female condom model- Anatomic Model

2010-02-08 Thread suji 0602
Female Condom Model - Anatomical Model \Manforce Condom hot sexy model photo Correct Condom Usage http://sites.google.com/site/quicksinfos warning adults!(+18) condom using photoes and videos http://sites.google.com/site/lovlybeautyz/ for more detail use this sites

[Rails] Uploading and Mailing documents

2010-02-08 Thread Pale Horse
What I want is a document uploader on the front end so my visitors can upload their CV or a completed application form and then submit this document. On submission, an email will be sent with the document attached to a specified email address. If any code is required, then don't hesitate to ask.

[Rails] Console not working

2010-02-08 Thread Trausti Thor Johannsson
I just installed Centos 5.4 64 bit. Nothing out of the ordinary, but this is a plain vanilla installation with ruby enterprise and passenger. My app works as it should, but when I try to run 'script/console' it does not load my models. I have to manually load them. Does anyone know why this

Re: [Rails] Re: Same partial different results

2010-02-08 Thread Colin Law
On 7 February 2010 23:19, brianp brian.o.pea...@gmail.com wrote: So it turns out it's not just the partial. Any dropdown select i ad to that page will not properly display :prompt. Now I have an ajax update method so If i change the select all selects are reloaded. And as soon as I change one

[Rails] Re: Multiple dependencies on Deletions

2010-02-08 Thread Sharagoz --
the deletion doesn't cascade to the master record That makes sense, because it would mean that if one truck record is deleted, then the rest of that masters truck records would also be deleted as well. Are you trying do delete the master record if it only has one truck record? If that's the

[Rails] Re: Uploading and Mailing documents

2010-02-08 Thread Sharagoz --
Rails comes with ActionMailer, which supports emailing attachments. http://guides.rubyonrails.org/action_mailer_basics.html -- 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] Re: Uploading and Mailing documents

2010-02-08 Thread Pale Horse
Sharagoz -- wrote: Rails comes with ActionMailer, which supports emailing attachments. http://guides.rubyonrails.org/action_mailer_basics.html Thank you, but first, I need my application to actually have the ability to upload the document I want to attach and mail. -- Posted via

[Rails] UJS in Rails 3 Beta

2010-02-08 Thread overture
Hi All, Does anyone know if there are any good examples of how to use the unobtrusive javascript functionality in Rails 3. I've read the release notes but I can't seem to get things working. I've just set up a simple Rails app with a Post model. In the _form partial I have add the :remote =

[Rails] Re: Uploading and Mailing documents

2010-02-08 Thread Sharagoz --
There are plenty of tutorials out there on how to do this, if you just google for it. For instance: http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Collection grouping/sorting question

2010-02-08 Thread eggie5
@coll= [{:period={:people=[#], :date=Sun, 08 Feb 2009}}, {:period={:people=[#, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #], :date=Sun, 15 Feb 2009}}, {:period={:people=[#, #, #, #, #, #, #, #, #, #, #, #, #, #], :date=Sun, 22 Feb 2009}}, {:period={:people=[#, #], :date=Sat, 28 Feb 2009}},

[Rails] Re: Design Pattern

2010-02-08 Thread eggie5
Another question related to this... I have everything grouped by common date, but now I want to do it my month. Any ideas? On Feb 4, 4:08 am, Rick DeNatale rick.denat...@gmail.com wrote: On Wed, Feb 3, 2010 at 3:58 AM, eggie5 egg...@gmail.com wrote: Hi, I have a collection of arbitrary

[Rails] Akshay Nawale wants to chat

2010-02-08 Thread Akshay Nawale
--- Akshay Nawale wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-63ba558873-726d82338f-2bba3f259d787d35 You'll need to

[Rails] Re: What happened to CoC?

2010-02-08 Thread tuti plain
I am not exactly sure what is meant by CoC, Continuity of Code? CoC means convention over configuration, which is supposed to be one of Rails' founding philosophies. if you are determined to play along with an outdated book that uses an outdated version of Rails, you might consider

[Rails] Re: Model using STI new function only working partially

2010-02-08 Thread Matt Jones
On Feb 7, 7:00 pm, Solly directxma...@gmail.com wrote: Hi, I have an application using STI on a model named Publisher.  Publisher uses STI via a column named service.  When I call -- p = Publisher.new(..., :service = TwitterPublisher) -- the service does not get assigned, yet all other

[Rails] Re: Rails 3 beta: bundle install not installing to the GEM_HOME

2010-02-08 Thread Matt Jones
On Feb 8, 12:46 am, Mat Brown m...@patch.com wrote: You're a software engineer using OS X? Odd. Are you *trying* to start a flamewar? --Matt Jones -- 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] Re: render :action = 'new' renders a blank page

2010-02-08 Thread Aldric Giacomoni
Diogo Delgado wrote: The fork code is available at: http://github.com/DBA/authlogic_openid I'm taking a look at the automatically generated content: def create @report = Report.new(params[:report]) respond_to do |format| if @report.save flash[:notice] = 'Report was

Re: [Rails] Error in Bundler with PostgreSQL and Rails3

2010-02-08 Thread Gianluca Tessarolo
I just try and all are working good under Ruby 1.8.7 MRI... (I did'nt try RVM...) I did'nt any special thing, I just install pg gem and run: rails xxx -d postgresql cd xxx I have modify config/database.yml adding = host: localhost and setting user / password rails generate scaffold user

Re: [Rails] Re: render :action = 'new' renders a blank page

2010-02-08 Thread kannav rajeev
is there is new.rhtml or new.html.erb in yours app. On Mon, Feb 8, 2010 at 7:50 PM, Aldric Giacomoni li...@ruby-forum.com wrote: Diogo Delgado wrote: The fork code is available at: http://github.com/DBA/authlogic_openid I'm taking a look at the automatically generated content:  def create  

Re: [Rails] Re: What happened to CoC?

2010-02-08 Thread Steve Klabnik
The Rails Way certainly is the de facto Rails book... but for Rails 1.2. I'm pretty sure it was never updated for 2.x, but I could be wrong. My copy is for 1.2. In any case, yeah, as everyone else said, it should work. The rake routes suggestion is a good one, since you're seeing a routing error.

[Rails] Re: How to call javascript function in A site?

2010-02-08 Thread Robert Walker
Jun Young wrote: head hello, this is template!! /head body a href='javascript:func_a(arg1, arg2, arg3)'click/a This is a very old technique and I would not recommend using this style to call JavaScript functions. Here is a more modern syntax: a href=# onclick=func_a(arg1, arg2, arg3);

Re: [Rails] Error in Bundler with PostgreSQL and Rails3

2010-02-08 Thread Gianluca Tessarolo
Wait a moment... Do you have removed the old versions of bundler gem ? (I think that is very important to have only the last version installed !!!) Hi there, I'm trying to get up and running with PostgreSQL 8.4 and the Rails 3 beta. I'm running on Ruby 1.8.7 via RVM and have installed the

[Rails] Re: Controller methods over instance variables?

2010-02-08 Thread Marnen Laibow-Koser
Andrew France wrote: Hi, I was thinking whether it would be more elegant for a view to call methods on the controller rather than rely on instance variables. The trouble with this is that controller methods are actions, not getters. I'm not really sure what the answer is so thought I

[Rails] Re: Uploading and Mailing documents

2010-02-08 Thread Marnen Laibow-Koser
Pale Horse wrote: Sharagoz -- wrote: Rails comes with ActionMailer, which supports emailing attachments. http://guides.rubyonrails.org/action_mailer_basics.html Thank you, but first, I need my application to actually have the ability to upload the document I want to attach and mail.

[Rails] Re: MySQL Installation Issues

2010-02-08 Thread Roy Stannard
Kirk Howard wrote: Whenever you can't build native extensions, it means there is some lib or lib-dev missing. Generally you'll need to do a sudo apt-get install lib-???-dev, or sudo apt-get install build_essential. This time, I had to install the following: 'sudo apt-get install

Re: [Rails] Re: Controller methods over instance variables?

2010-02-08 Thread Andrew France
On 09/02/10 01:32, Marnen Laibow-Koser wrote: Andrew France wrote: Hi, I was thinking whether it would be more elegant for a view to call methods on the controller rather than rely on instance variables. The trouble with this is that controller methods are actions, not getters.

[Rails] Conditions in form_for

2010-02-08 Thread Hemant Bhargava
Hey guys, How can we give two form_for based on conditions? I mean like this:- unless condition1.nil? form_for :abc, :url = { :action = 123 } do |f| else form_for :abc, :url = { :action = 234 } do |f| end This is not working. Can you guyz tell me where is the problem ? How can i write this

Re: [Rails] Polymorphic association question

2010-02-08 Thread Mat Brown
The polymorphic :locatable association implies a :locatable_type and :locatable_id column. These columns reference a row in an arbitrary table identified by :locatable_type so no join table is needed. On Feb 7, 2010 11:02 PM, Sean Six li...@ruby-forum.com wrote: This is an example from the

[Rails] Re: Controller methods over instance variables?

2010-02-08 Thread David Chelimsky
On Feb 8, 4:44 am, Andrew France andrew+li...@avito.co.uk wrote: Hi, I was thinking whether it would be more elegant for a view to call methods on the controller rather than rely on instance variables. I'm not really sure what the answer is so thought I would throw it out here. Perhaps

[Rails] Re: Re: Controller methods over instance variables?

2010-02-08 Thread Marnen Laibow-Koser
Andrew France wrote: On 09/02/10 01:32, Marnen Laibow-Koser wrote: Andrew France wrote: Hi, I was thinking whether it would be more elegant for a view to call methods on the controller rather than rely on instance variables. The trouble with this is that controller methods are

Re: [Rails] Re: page view counter

2010-02-08 Thread bill walton
Hi, On Sat, 2010-02-06 at 09:40 -0800, señor tower wrote: Thanks for our unfounded point of view Marnen. I still would like to know if anyone else has come across anything similar. a simple hit counter... to display some basic metrics. thanks so much. We did something on a project I

[Rails] Re: Conditions in form_for

2010-02-08 Thread Hemant Bhargava
@action = condition1.nil? ? '234' : '123' Thanks for a quickie dude.. Resolved .. :) And in the view: form_for :abc, :url = {:action = @action} do |f| Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You

[Rails] How to write an outgoing URL call and get the XML response ?

2010-02-08 Thread Erwin
I have to write a call from my rails app to an external URL : http://999:mad...@api.bingostore.com/apis/media.php?action=createCollectioncollection_id=123 then I should get back an XML answer , to be parsed (I need to reuse these info into my web app) collection id180/id

[Rails] Re: How to write an outgoing URL call and get the XML response ?

2010-02-08 Thread Erwin
thanks a lot, I am going to have a look at Nokogiri yves On 8 fév, 17:46, Mat Brown m...@patch.com wrote: You can use Net::HTTP, which is part of the standard Ruby library, to make the external request. REXML, also part of the standard library, can parse it, though I'd suggest using Nokogiri

[Rails] can use use observe_field with a 3rd party server?

2010-02-08 Thread dino d.
Hi- I'm trying to implement an auto-complete using Yahoo's autocomplete server, which basically suggests search completions: http://ff.search.yahoo.com/gossip?output=fxjsoncommand={your searchterms}' if you want to see the results in your browser, use xml instead:

Re: [Rails] Warbler question for deployment on Tomcat

2010-02-08 Thread Nick Sieger
On Sat, Feb 6, 2010 at 6:38 PM, MichaelF mich...@fromin.org wrote: I am using Rail 2.2.2 with JRuby 1.4 to deploy to a Tomcat 6 server. In looking through the Warbler documentation I am stumped on the proper settings for a couple of parameters. In my warble.rb file I see lines for: #

[Rails] checking for nil

2010-02-08 Thread Ketema Harris
HI, I have inherited support on a rails website and I am encountering the following problem: % if @request.env['HTTP_USER_AGENT'].downcase.index('msie 6.0')!=nil % %= stylesheet_link_tag 'ie6' % % elsif @request.env['HTTP_USER_AGENT'].downcase.index('msie

[Rails] Double render/redirect philosophy

2010-02-08 Thread Ralph Shnelvar
Ok, I think I understand why RoR will flag an attempt double render in an action. What I don't understand is the philosophy of render and redirect_to. Specifically, why isn't a return implicit in both those methods? Or, I guess, more to the point ... what are the advantages of writing code in

Re: [Rails] Double render/redirect philosophy

2010-02-08 Thread Mat Brown
There isn't much point in writing code after a render/redirect in a controller method, and it's safe to say it's a best practice not to. I think the main reason render/redirect work the way they do is to make it easier to use those methods in before/after_filters. For what it's worth, Merb's

[Rails] Re: checking for nil

2010-02-08 Thread Marnen Laibow-Koser
Ketema Harris wrote: HI, I have inherited support on a rails website and I am encountering the following problem: % if @request.env['HTTP_USER_AGENT'].downcase.index('msie 6.0')!=nil % %= stylesheet_link_tag 'ie6' % % elsif

Re: [Rails] checking for nil

2010-02-08 Thread bill walton
Hi Katerna, Rails has a handy helper for this. blank? returns true for false, empty or whitespace strings. nil is false. You'll need to move the negation to the beginning. On Mon, 2010-02-08 at 19:53 +0100, Ketema Harris wrote: % if @request.env['HTTP_USER_AGENT'].downcase.index('msie

[Rails] ECONNABORTED: An established connection was aborted

2010-02-08 Thread Ralph Shnelvar
What, exactly, does ECONNABORTED: An established connection was aborted by the software in your host machine. mean? So ... let's start with the most basic of questions: What's a connection? When one has a connection, does there have to be communication back-and-forth periodically before the

[Rails] Re: checking for nil

2010-02-08 Thread Aldric Giacomoni
Ketema Harris wrote: HI, I have inherited support on a rails website and I am encountering the following problem: % if @request.env['HTTP_USER_AGENT'].downcase.index('msie 6.0')!=nil % %= stylesheet_link_tag 'ie6' % If the user agent is for IE6... %

Re: [Rails] Double render/redirect philosophy

2010-02-08 Thread Mohit Sindhwani
On 9/2/2010 3:04 AM, Ralph Shnelvar wrote: Ok, I think I understand why RoR will flag an attempt double render in an action. What I don't understand is the philosophy of render and redirect_to. Specifically, why isn't a return implicit in both those methods? Or, I guess, more to the point ...

Re: [Rails] Re: checking for nil

2010-02-08 Thread Rob Biedenharn
On Feb 8, 2010, at 2:13 PM, Aldric Giacomoni wrote: Ketema Harris wrote: HI, I have inherited support on a rails website and I am encountering the following problem: % if @request.env['HTTP_USER_AGENT'].downcase.index('msie 6.0')! =nil % %= stylesheet_link_tag 'ie6' %

[Rails] Re: Re: checking for nil

2010-02-08 Thread Ketema Harris
Rob Biedenharn wrote: On Feb 8, 2010, at 2:13 PM, Aldric Giacomoni wrote: @request.env['HTTP_USER_AGENT'].downcase.index('msie 7.0')!=nil % nil:NilClass) how can i edit this code so that it can handle an empty user agent string? Ah, I see. You want 'nil' .. So you should first say that :

[Rails] Re: can use use observe_field with a 3rd party server?

2010-02-08 Thread Frederick Cheung
On Feb 8, 5:19 pm, dino d. dinodorr...@yahoo.com wrote: Am I violating some rule about cross-site ajax calls?  Can I have my server generate the observe_field code which calls a 3rd party server for ajax updates, like observe_field? The javascript that observe_field generates will mean that

[Rails] Testing Java Script in a View

2010-02-08 Thread Rails Learner
Hello Everybody, I am a newbie with rails, so please forgive me if I made a mistake. I have a link in a view that uses java script to toggle a div. Now, I need to test this. But I simply don't know how to trigger the action of clicking on a link (to toggle the page element) in a test. I have

[Rails] ActiveModel callbacks

2010-02-08 Thread Robert K.
Hi, I've set up several ActiveModel callbacks an run them via _run_whatever_callbacks do .. some code end Now i would like to run the before_whatever and after_whatever independently, aka _run_before_whatever_callbacks. Is that somehow possible? I need that for running the callbacks on a set

[Rails] Re: Testing Java Script in a View

2010-02-08 Thread Robert K.
Hey, checkout Selenium (http://seleniumhq.org/). You can use that with webrat and/or cucumber to test javascript within your browser. Robert -- 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

Re: [Rails] checking for nil

2010-02-08 Thread Greg Donald
On Mon, Feb 8, 2010 at 12:53 PM, Ketema Harris li...@ruby-forum.com wrote: HI, I have inherited support on a rails website and I am encountering the following problem: % if @request.env['HTTP_USER_AGENT'].downcase.index('msie 6.0')!=nil %                        %= stylesheet_link_tag 'ie6' %

[Rails] Why are double sided polymorphic relationships lacking in Rails?

2010-02-08 Thread tsenart
http://stackoverflow.com/questions/2224994/why-are-double-sided-polymorphic-relationships-lacking-in-rails -- 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

[Rails] How to use ruby script/console to debug methods in application.rb?

2010-02-08 Thread lukas
Hello everyone, newbie question: I have a couple of methods that interact with a remote python server in application.rb. Is there a convenient way to debug them? e.g. run them from ruby script/console - debug-console and see the return values? Example-method: def

Re: [Rails] Why are double sided polymorphic relationships lacking in Rails?

2010-02-08 Thread Mat Brown
Inverse associations will be standard in Rails 2.3.6. For the impatient, here's a backport: http://github.com/oggy/inverse_of Mat On Mon, Feb 8, 2010 at 16:43, tsenart tsen...@gmail.com wrote:

[Rails] Re: Page generation time

2010-02-08 Thread Idler Xian
I want this too, thanks very much. David B. wrote: Hi everybody, Is there a simple way to get the page generation time and display it in a view? I believe so because this information is published in the terminal (in development mode). Thanks, Dendicus -- Posted via

[Rails] Re: Page generation time

2010-02-08 Thread Marnen Laibow-Koser
David B. wrote: Hi everybody, Is there a simple way to get the page generation time and display it in a view? I believe so because this information is published in the terminal (in development mode). The rails_footnotes plugin, perhaps? Thanks, Dendicus Best, --  Marnen Laibow-Koser

Re: [Rails] Re: Page generation time

2010-02-08 Thread Mat Brown
Check out Rack::Bug On Feb 8, 2010 5:19 PM, Idler Xian li...@ruby-forum.com wrote: I want this too, thanks very much. David B. wrote: Hi everybody, Is there a simple way to get the page generation time and display it in a view? I believe so because this information is published in the

[Rails] Re: How to use ruby script/console to debug methods in appl

2010-02-08 Thread Marnen Laibow-Koser
lukas wrote: Hello everyone, newbie question: I have a couple of methods that interact with a remote python server in application.rb. Is there a convenient way to debug them? e.g. run them from ruby script/console - debug-console and see the return values? Just set a breakpoint, run

[Rails] recommending friends, using RoR's Mailer

2010-02-08 Thread RubyonRails_newbie
Hi there, I wan tto be able to allow users to invite friends... The action below is exactly the same as the code used to send a user their username. Only difference is, I need to change the ''user = User.find_by_email(email)'' part as obviously, I dont want to only email people who are already on

[Rails] Re: reCAPTCHA headache

2010-02-08 Thread Kyle
Eric, I have it going using the validation syntax recommended in the RDoc: if verify_recaptcha(:model = @job) @job.save ... When I tried using an if/else for the validation, a mismatch threw an error. -Kyle -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Re: Error in Bundler with PostgreSQL and Rails3

2010-02-08 Thread Michael Jurewitz
So looks like this is an issue with the PostgreSQL install that I happened to snag. I just finished blowing everything away and reinstalling it all from MacPorts and it's working like a charm. Huge thanks for your hep, Gianluca! -J Gianluca Tessarolo wrote: I just try and all are working

[Rails] Re: What happened to CoC?

2010-02-08 Thread pepe
I have a version of the book with something that looks like a circular stamp on the cover that says Covers Rails 2.0, so I guess it has been updated. ;) And I would have to agree with Marnen. It looks like you have a routing issue. Cheers. On Feb 8, 8:16 am, tuti plain li...@ruby-forum.com

[Rails] Object Version Control, or at least edit log

2010-02-08 Thread PsiPro
Hello all, I need to create a object history, as I'll have multiple editors for a site i am working on. Of course it would be great to have the ability to restore an object to its state and undo the damage due to a bad editor, but I'll settle for a system that will tell me who to blame.

[Rails] Re: Object Version Control, or at least edit log

2010-02-08 Thread Erol Fornoles
On Feb 9, 11:48 am, PsiPro arjes...@gmail.com wrote: Hello all, I need to create a object history, as I'll have multiple editors for a site i am working on. Of course it would be great to have the ability to restore an object to its state and undo the damage due to a bad editor, but I'll

[Rails] Getting Twitter usernames

2010-02-08 Thread Rails ROR
Hi all, I want to display the list of all twitter user names.' Please suggest me something on that Getlists is a method which i have seen it in the API looking forward for a response Thankyou -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] acts_as_tree question

2010-02-08 Thread db_333
Hi, I'm trying to implement a very simple acts_as_tree search in my index html. I am able to show the parents, with no issue, but the children will not show. I have something like this for the parent, which displays fine: % for group in Group.roots % td tr a href=#

Re: [Rails] acts_as_tree question

2010-02-08 Thread Gianluca Tessarolo
Hi, I think you've made a little mistake... The correct form is this: % for group in Group.roots % ... %= link_to (group.name), group % ... % for child in group.children % ... %= link_to (child.name), child % ... Notice the use of group.children instead Group.children Hope

[Rails] Re: acts_as_tree question

2010-02-08 Thread db_333
Yes, this was helpful, and I appreciate it. Thanks for your reply. On Feb 8, 11:29 pm, Gianluca Tessarolo tessarolo.gianl...@mediamaster.it wrote: Hi, I think you've made a little mistake... The correct form is this: % for group in Group.roots %   ...   %= link_to (group.name), group