[Rails] Re: Two buttons respond to same action

2011-05-29 Thread Stefano
I think I can speak for most people (yeah notice the most, didnt want to speak for everybody) here in saying, no we cant. On May 29, 6:51 am, amritpal pathak amritpalpath...@gmail.com wrote: On Sat, May 28, 2011 at 12:30 PM, Frederick Cheung frederick.che...@gmail.com wrote: On May 28,

Re: [Rails] Re: Two buttons respond to same action

2011-05-29 Thread Chris Kottom
This should be everyone's starting point when first learning about Rails routing: http://guides.rubyonrails.org/routing.html Read it a couple of times at least. If you're still unsure, at least you'll have enough context to come back and ask specific questions about the parts you don't

[Rails] Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread egervari
I have just started using 3.0.7. I am about 2 weeks of development in. I was wondering if I should keep building for 3.0.7 or switch to 3.1 before I have too much code to port over? I like most of the new features (my only fear is not having good error messages when I use coffeescript), so I'd

[Rails] Re: how can I investigate when a rspec test fails?

2011-05-29 Thread egervari
On May 28, 1:59 pm, Mauro mrsan...@gmail.com wrote: For example: it re-renders the 'new' template do       # Trigger the behavior that occurs when invalid params are submitted       Sector.any_instance.stub(:save).and_return(false)       post :create, :sector = {}       response.should

Re: [Rails] Re: Two buttons respond to same action

2011-05-29 Thread amritpal pathak
On Sun, May 29, 2011 at 4:12 AM, Chris Kottom ch...@chriskottom.com wrote: This should be everyone's starting point when first learning about Rails routing: http://guides.rubyonrails.org/routing.html Read it a couple of times at least. If you're still unsure, at least you'll have enough

[Rails] Re: Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread egervari
Well, I got most things to work. I just have to figure out my assets now. I made the folders and organized them. Now it's time to get them to work ;) -- 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

Re: [Rails] Re: Two buttons respond to same action

2011-05-29 Thread amritpal pathak
On Sun, May 29, 2011 at 7:16 AM, amritpal pathak amritpalpath...@gmail.comwrote: On Sun, May 29, 2011 at 4:12 AM, Chris Kottom ch...@chriskottom.comwrote: This should be everyone's starting point when first learning about Rails routing: http://guides.rubyonrails.org/routing.html Read it a

Re: [Rails] Re: Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread Gintautas Šimkus
If you see a lot of improvements that you personal would use in 3.1 over 3.0.7, then you should think about switching. Another thing to consider is deadlines, as upgrading will push the moment you are ready to go to production further. You yourself raised a great question: will all the gems work

Re: [Rails] Re: Two buttons respond to same action

2011-05-29 Thread Colin Law
On 29 May 2011 13:17, amritpal pathak amritpalpath...@gmail.com wrote: On Sun, May 29, 2011 at 7:16 AM, amritpal pathak amritpalpath...@gmail.com wrote: On Sun, May 29, 2011 at 4:12 AM, Chris Kottom ch...@chriskottom.com wrote: This should be everyone's starting point when first learning

Re: [Rails] Re: Two buttons respond to same action

2011-05-29 Thread amritpal pathak
On Sun, May 29, 2011 at 8:29 AM, Colin Law clan...@googlemail.com wrote: On 29 May 2011 13:17, amritpal pathak amritpalpath...@gmail.com wrote: On Sun, May 29, 2011 at 7:16 AM, amritpal pathak amritpalpath...@gmail.com wrote: On Sun, May 29, 2011 at 4:12 AM, Chris Kottom

[Rails] Re: Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread egervari
On May 29, 8:12 am, egervari ken.egerv...@gmail.com wrote: Well, I got most things to work. I just have to figure out my assets now. I made the folders and organized them. Now it's time to get them to work ;) Yay, I got the css to work. I had a circular dependency since I had 2 main

[Rails] Re: Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread egervari
On May 29, 8:28 am, Gintautas Šimkus dihita...@gmail.com wrote: If you see a lot of improvements that you personal would use in 3.1 over 3.0.7, then you should think about switching. Another thing to consider is deadlines, as upgrading will push the moment you are ready to go to production

Re: [Rails] Re: Two buttons respond to same action

2011-05-29 Thread Colin Law
On 29 May 2011 13:33, amritpal pathak amritpalpath...@gmail.com wrote: On Sun, May 29, 2011 at 8:29 AM, Colin Law clan...@googlemail.com wrote: On 29 May 2011 13:17, amritpal pathak amritpalpath...@gmail.com wrote: On Sun, May 29, 2011 at 7:16 AM, amritpal pathak

Re: [Rails] Re: Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread Gintautas Šimkus
Hi again :) Glad it all worked for you. Even if you didn't migrate right now, it would be a good learning experience (upgrading rails version of production site). So it's a win win situation basically. Don't know the answer to your JS problem, maybe somebody else might help on that. 2011/5/29

Re: [Rails] Re: Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread Martin Wawrusch
Depending on the kind of site you might want to use mvc views through backbone or something similar and launch specific views depending on the current page, something like so: html: body class=´users search_page´ ... and in your coffeescripts (you do use coffeescript :P) class UserSearchView

[Rails] Re: Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread egervari
On May 29, 8:53 am, Martin Wawrusch mar...@wawrusch.com wrote: Depending on the kind of site you might want to use mvc views through backbone or something similar and launch specific views depending on the current page, something like so: html: body class=´users search_page´ ... and in

[Rails] Re: Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread egervari
class UserSearchView extends Backbone.View # or controller ... initialize: - here goes your page specific initializers $ - window.currentView = new UserSearchView if $(´body.users.search').length 0 This solution looks interesting, and it also looks potentially dangerous. I'm not a

Re: [Rails] Re: Two buttons respond to same action

2011-05-29 Thread Michael Pavling
On 29 May 2011 13:29, Colin Law clan...@googlemail.com wrote:  Readers may find it interesting to read http://www.ruby-forum.com/topic/1610794 where he posts under both aliases, thanking himself for support. Good effort. I'd forgotten about that thread (there were so many...)  It is clear that

Re: [Rails] Re: Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread Martin Wawrusch
I guess I am going to blog about this once I have a bit more time. In general my observation with websites and javascript is that you have lots of code that applies to all pages if you structure it right (usage of class names in css), and very few pages that have intense, page specific code. The

Re: [Rails] Re: Two buttons respond to same action

2011-05-29 Thread amritpal pathak
On Sun, May 29, 2011 at 8:44 AM, Colin Law clan...@googlemail.com wrote: On 29 May 2011 13:33, amritpal pathak amritpalpath...@gmail.com wrote: On Sun, May 29, 2011 at 8:29 AM, Colin Law clan...@googlemail.com wrote: On 29 May 2011 13:17, amritpal pathak amritpalpath...@gmail.com

[Rails] action url with anchor - ( not a js guru)

2011-05-29 Thread Erwin
in my user_helper.rb def registration_form content_for(:ready) do window.location = window.location.href + '#register_form'; end end in my new.html.haml view - registration_form first pass (correct) http://localhost:3000/en_GB/signup#register_form subsequent pass (

[Rails] Re: Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

2011-05-29 Thread egervari
On May 29, 9:27 am, Martin Wawrusch mar...@wawrusch.com wrote: I guess I am going to blog about this once I have a bit more time. In general my observation with websites and javascript is that you have lots of code that applies to all pages if you structure it right (usage of class names in

[Rails] Rails 3.1.0.rc1 assets not compiling

2011-05-29 Thread noel_g
I started a test app to try out 3.1 At first .coffee files were compiling into application.js, but now nothing is compiled. I set up 2 .coffee files with alerts and expected //=require_tree to incorporate them into application.js, but that does not happen. ran rake assets:precompile and indeed

Re: [Rails] Re: Two buttons respond to same action

2011-05-29 Thread Bryan Crossland
Sent from my iPhone On May 29, 2011, at 8:47 AM, amritpal pathak amritpalpath...@gmail.com wrote: On Sun, May 29, 2011 at 8:44 AM, Colin Law clan...@googlemail.com wrote: On 29 May 2011 13:33, amritpal pathak amritpalpath...@gmail.com wrote: On Sun, May 29, 2011 at 8:29 AM, Colin Law

[Rails] Re: action url with anchor - ( not a js guru)

2011-05-29 Thread Erwin
got the answer from js guru .. use = window.location.href.indexOf('#register_form') == -1 On 29 mai, 16:05, Erwin yves_duf...@mac.com wrote: in my user_helper.rb    def registration_form       content_for(:ready) do         window.location = window.location.href + '#register_form';      

[Rails] Encoding issue (I think): All apostrophes have changed to these odd characters after a database switch

2011-05-29 Thread daze
I'm wondering if anyone can give any insight into how I could resolve the problem on this website: http://jdrampage.com/ basically, all the ’ are supposed to be apostrophes ( ' ), and quotes are messed up too... Is it possible to run some command in the rails console production to fix this?

[Rails] Re: Encoding issue (I think): All apostrophes have changed to these odd characters after a database switch

2011-05-29 Thread Frederick Cheung
On May 29, 6:45 pm, daze dmonopol...@gmail.com wrote: I'm wondering if anyone can give any insight into how I could resolve the problem on this website: http://jdrampage.com/ basically, all the ’ are supposed to be apostrophes ( ' ), and quotes are messed up too... Is it possible to run

Re: [Rails] Re: how can I investigate when a rspec test fails?

2011-05-29 Thread Mauro
On 29 May 2011 10:45, egervari ken.egerv...@gmail.com wrote: On May 28, 1:59 pm, Mauro mrsan...@gmail.com wrote: For example: it re-renders the 'new' template do       # Trigger the behavior that occurs when invalid params are submitted       Sector.any_instance.stub(:save).and_return(false)

Re: [Rails] Re: how can I investigate when a rspec test fails?

2011-05-29 Thread Mauro
On 29 May 2011 19:35, Mauro mrsan...@gmail.com wrote: On 29 May 2011 10:45, egervari ken.egerv...@gmail.com wrote: On May 28, 1:59 pm, Mauro mrsan...@gmail.com wrote: For example: it re-renders the 'new' template do       # Trigger the behavior that occurs when invalid params are submitted  

Re: [Rails] Rails 3.1.0.rc1 assets not compiling

2011-05-29 Thread Noel
found the problem. There can't be any blank lines in the manifest https://github.com/noel/happy/blob/master/app/assets/javascripts/application.js#L8-10 Is this a bug or should the text in the generated file be more explicit? On Sun, May 29, 2011 at 8:19 AM, noel_g wwydi...@gmail.com wrote:

[Rails] How to get error message out of ActiveRecord::Base.connection.raw_connection

2011-05-29 Thread David Kahn
I run this code to import a large csv file into a table in Postgres: connection = ActiveRecord::Base.connection.raw_connection connection.exec(%q[COPY import_xp_raw_bill_details FROM STDIN DELIMITERS ',' CSV]) data = File.open(file_path).read data.each_line {|line|

[Rails] Re: How to use an ActiveRecord plugin in a non-Rails project

2011-05-29 Thread Josh Cheek
On Sat, May 28, 2011 at 7:32 AM, Josh Cheek josh.ch...@gmail.com wrote: I was thinking I could probably fork it, give it a gemspec, and then tell Bundler to look at my forked repo, does that sound reasonable? I ended up doing this. https://github.com/JoshCheek/acts_as_list Add one fairly

Re: [Rails] Ruby on Rails - send_file

2011-05-29 Thread Jim Ruther Nill
On Fri, May 27, 2011 at 10:00 PM, Sayuj Othayoth li...@ruby-forum.comwrote: I am using the send_file method to download a file. It works fine on my local machine. But it's not working on the server - it returns a blank file. code: send_file Rails.root.join('public', 'uploads') +

[Rails] calculating running averages

2011-05-29 Thread Matt Harrison
I'm working on a community app that allows the residents of a village to log and monitor the traffic going past their houses. There are multiple locations which have many log entries with a traffic count and a time block. I want to let users view a location and see the average vehicles per