Re: [Rails] Transaction - but no rollback?

2011-05-08 Thread Frederick Cheung
On 8 May 2011, at 18:41, yanosz wrote: > Hello, > > I'm having trouble with transactions with rails 3.0.3 and mysql 5. I'd > like to import data etl-batch-style: > class Job < ActiveRecord::Base > # ... > def perform_etl >connection.transaction do > extract # some connection.execute

Re: [Rails] Constants and Configurations

2011-05-08 Thread Tiago Veloso
I am understanding better what you mean. I was referring to if you have a config that is of boolean type, another config that is integer and another that is of float type. I was picturing one table per type. Tiago Veloso ti.vel...@gmail.com On May 8, 2011, at 20:27 , Colin Law wrote: > On

[Rails] Spork + Autotest Failure

2011-05-08 Thread ylluminate
Hi folks, I'm going through railstutorial.org and so I apologize if I'm hitting the wrong group here and would appreciate any appropriate redirection if necessary. I've set up Spork + Autotest as per Michael's instructions in http://ruby.railstutorial.org/chapters/static-pages#sec:testing_tools E

[Rails] My web developer has abandoned me with a Rails site. NEED HELP ASAP

2011-05-08 Thread grouppicture
Im looking for immediate help. My web developer had started building me a site in Rails and has since gone AWOL and now I need to change info on the site but I have ZERO experience with code of any type. I'm looking for a hero who can help walk me through editing some copy that needs to be done ASA

[Rails] This is abhilash here need help...in installing rubygems...finding some error

2011-05-08 Thread abhi
Hi i have installed Cygwin as instructed on the tutorial of Maichel Hartl on the windows Xp suscessfully... in the next step i openned the link http://rubyforge.org/frs/?group_id=126 from where i selected the rubygems-1.8.1.tgz. Then when i typed ls for which i got the msg as rubygems-1.8.1 till h

[Rails] Transaction - but no rollback?

2011-05-08 Thread yanosz
Hello, I'm having trouble with transactions with rails 3.0.3 and mysql 5. I'd like to import data etl-batch-style: class Job < ActiveRecord::Base # ... def perform_etl connection.transaction do extract # some connection.execute / job.update_attribute stuff transform # some conn

[Rails] Re: Rails3 + rcov

2011-05-08 Thread Pavel K.
Just use CoverMe – Code Coverage for Ruby 1.9 https://github.com/markbates/cover_me -- 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-talk@googleg

[Rails] post jobs on rails-bestpractices.com

2011-05-08 Thread huang zhimin
Hi, I'm glad to say that job board has been added on rails-bestpractices.com, you can post ruby/rails related jobs on it, I hope companies can find good rails developers and rails developers can find good rails jobs on it, it's a win-win. Thanks, Richard -- Best regards, Richard Huang flyer...@

[Rails] FasterCSV::MalformedCSVError

2011-05-08 Thread TomRossi7
Is this seriously the best way to handle capturing an exception on a malformed csv file? There has to be a more elegant solution. http://matthewbass.com/2009/12/03/processing-malformed-files-with-fastercsv/ Thanks, Tom -- You received this message because you are subscribed to the Google Group

Re: [Rails] Re: Running my RAILS APP on Local area network using Windows XP as server os.

2011-05-08 Thread Norm Scherer
On 05/06/2011 08:14 PM, sukesh wrote: Hello Walter, Thanks for the reply. I just want to run my final year engineering project on windows based LAN. i use webrick as my server so i want to knw how can i run the app in one machine and access in oder systems. I have not be alloted a special server

[Rails] How to get my cart destroy to run a line item destroy method

2011-05-08 Thread Ruby Tuesday
Hello, Complete novice here. I have a line_item that once created or updated calculates the capacity left and displays it in the events view. The Add to Cart button triggers the create line_item method. I've added further capacity calculations to the line_item destroy method. My problem is that

[Rails] Re: WEBrick sending wrong http status code?

2011-05-08 Thread Michael Hanna
Thanks, this helped. For future reference, the code I wrote that worked is: format.json {head(:unauthorized)} Michael On May 8, 5:11 am, Frederick Cheung wrote: > On 8 May 2011, at 04:51,MichaelHanna wrote: > > > Testing my login page, when I POST the wrong password I should expect > > a 401 U

[Rails] Re: (Beginner) Finding a database object within a time interval

2011-05-08 Thread Anders_P
Thanks for the tip, got a bit cleaner. On May 8, 8:02 pm, Frederick Cheung wrote: > On 8 May 2011, at 18:51, Anders_P wrote: > > > Thanks for your answer, I think I got it to work. > > > def current_tee > >  current_time = Time.now > >  @current_tee = Tee.find :all, :conditions => [ > >    "feat

Re: [Rails] Constants and Configurations

2011-05-08 Thread Colin Law
On 8 May 2011 17:49, Tiago Veloso wrote: > Hi Colin, > > I see how could that go, but what If my configurations are of different types? I don't understand what you mean. > > Is there a gem that provides some helper methods that you could recommend? I don't know of one. It hardly seems worthwhi

[Rails] R3.1b1 - sharing assets

2011-05-08 Thread Tomas Celizna
Hello all, is there a way to share assets in Rails 3.1 beta1 between an app and an engine? It works locally, but not in production -- I guess because of the CSRF token? Thanks, T -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post t

[Rails] Re: Beginners question | moving a method from controller to model

2011-05-08 Thread Ruby Tuesday
Jeffrey L. Taylor wrote in post #997405: > See inserted comments below. > > Quoting linda Keating : >> new_capacity = event.capacity >> format.xml { render :xml => @line_item, :status => :created, >> >> > new_capacity and event are local variables in the controller method. > They are

[Rails] How to redirect from within a .js script

2011-05-08 Thread Erwin
I need to redirect from within an action called by an Ajax request def create .. respond_with resource do |format| format.js { .. # test on user locale and changed I18n.default_locale = resource.current_membership.account_type.locale.code.to_sym I18n.locale = I18n.default_local

[Rails] How to handle orphans?

2011-05-08 Thread Jeffrey L. Taylor
The requirements for my Web app have changed and now instead of destroying an object and all children when it expires, I need to destroy the parent object when the last child is destroyed. Is there a builtin or gem to do this? Is it better to check the cached count in the parent (reference counti

[Rails] Re: Routes - Search url parser

2011-05-08 Thread danimashu
For give a example, the url I hope to have is something like that: - example.com/brand/ford/color/red - example.com/brand/ford - example.com/color/red The idea is to have the same that: - example.com/cars?brand=ford&color=red But really, the user already knows that Ford is a brand and Red is a co

Re: [Rails] Re: (Beginner) Finding a database object within a time interval

2011-05-08 Thread Frederick Cheung
On 8 May 2011, at 18:51, Anders_P wrote: > Thanks for your answer, I think I got it to work. > > def current_tee > current_time = Time.now > @current_tee = Tee.find :all, :conditions => [ >"featured = true AND start_date < '#{current_time}' AND end_date >> = '#{current_time}'" > ] > end

Re: [Rails] Beginners question | moving a method from controller to model

2011-05-08 Thread Jeffrey L. Taylor
See inserted comments below. Quoting linda Keating : > I'm learning with the Agile Web Development 4th edition book. I've > built a method in my controller to test that it works, and now I want to > move it to the model. > > *** line_item controller *** >

Re: [Rails] Constants and Configurations

2011-05-08 Thread Tiago Veloso
Hi Colin, I see how could that go, but what If my configurations are of different types? Is there a gem that provides some helper methods that you could recommend? I am using rails 3. Tiago Veloso ti.vel...@gmail.com On May 8, 2011, at 11:22 , Colin Law wrote: > On 8 May 2011 11:08, Tiago V

[Rails] Re: (Beginner) Finding a database object within a time interval

2011-05-08 Thread Anders_P
Thanks for your answer, I think I got it to work. def current_tee current_time = Time.now @current_tee = Tee.find :all, :conditions => [ "featured = true AND start_date < '#{current_time}' AND end_date >= '#{current_time}'" ] end I had also forgot ' ' before and after '#{current_time}'.

Re: [Rails] Re: Form without scaffold ?

2011-05-08 Thread Colin Law
On 8 May 2011 16:29, John shelfer wrote: > ... > I created a button and add a action to it as: > <%= button_to 'Add to Cart', :action => 'Click' %> > > And then made a empty method named "click" in  controller ,so now when > i clicked on buttton it says: > No route matches {:controller=>"store", :

Re: [Rails] Beginners question | moving a method from controller to model

2011-05-08 Thread David Kahn
On Sun, May 8, 2011 at 12:00 PM, linda Keating wrote: > I'm learning with the Agile Web Development 4th edition book. I've > built a method in my controller to test that it works, and now I want to > move it to the model. > > *** line_item controller *** > **

[Rails] Re: Javascript Polling and Ruby on Rails

2011-05-08 Thread Walter Lee Davis
On May 8, 9:46 am, "BlackHe@art" wrote: > Hello, > > I am new to Ruby on Rails and sometimes having a real hard time tying > everything together... > > For my mobile website I have to get the current position (geolocation) > of a user every 5 minutes and compare this position and the current > t

[Rails] Beginners question | moving a method from controller to model

2011-05-08 Thread linda Keating
I'm learning with the Agile Web Development 4th edition book. I've built a method in my controller to test that it works, and now I want to move it to the model. *** line_item controller *** def create @cart = current_cart

[Rails] Re: Activerecord::JDBCError: Invalid column number

2011-05-08 Thread Klaus Humme
Matt Jones wrote in post #997376: > Do you get the same behavior if you just call 'MandateFile.columns'? Hi Matt, MandateFile.columns quits with RuntimeError: The driver encountered an unknown error: java.lang.NullPointerException: null > I suspect you will - this sounds like an issue with th

[Rails] Javascript Polling and Ruby on Rails

2011-05-08 Thread BlackHe@art
Hello, I am new to Ruby on Rails and sometimes having a real hard time tying everything together... For my mobile website I have to get the current position (geolocation) of a user every 5 minutes and compare this position and the current time with values of position/time stored in my database. D

[Rails] Re: Form without scaffold ?

2011-05-08 Thread John shelfer
On May 4, 10:16 am, Walter Davis wrote: > On May 4, 2011, at 10:06 AM, John shelfer wrote: > > > Hi > >     Strange to Rails.Read the tutorial on Scaffold.Can i generate a > > Simple form without using Scaffold? > > > John > > Scaffold is there to get you started, and to provide a good mainstrea

Re: [Rails] (Beginner) Finding a database object within a time interval

2011-05-08 Thread Frederick Cheung
On 8 May 2011, at 13:58, Anders_P wrote: > Hello, > > I'm trying to create a find statement that should find an element > which start_date and end_date are within Time.now. If I for example > have an object with a start_date of 2011-05-04 and end_date of > 2011-05-19, the find statement should

[Rails] Nested model form

2011-05-08 Thread simbora
Hello, I've got a problem with nested model form. I need to post just Comments. And they are referenced to Links which are referenced to Category. https://gist.github.com/961300 The current form in app/views/links/show.html.erb doesn't work for me. I want it to be able to post new comment to lin

[Rails] Re: Activerecord::JDBCError: Invalid column number

2011-05-08 Thread Matt Jones
On May 8, 3:36 am, Klaus Humme wrote: > Okay, I've choesen an other table with only 11 columns and listed them > all: > > class MandateFile < ActiveRecord::Base > >   # fix non-standard table and primary key name conventions >   set_table_name :AZLOELOG >   set_primary_key :D_AZLOGNR > >   alias

[Rails] Mongoid rails 3

2011-05-08 Thread Aashish Kiran
Hi, I am using mongoid, rails, mongohq. I have to tables Category and SubCategory Category references_many :subcategories SubCategory referenced_in :category Now I have a form in view. In view, when user chooses a category, an ajax request is made to get dependent subcategories. But problem is,

[Rails] Routes - Search url parser

2011-05-08 Thread danimashu
Hello, I'm trying to set my routes.rb. I have Car that belongs to Color and Brand. I want to build a clear url searcher without visible variables. It's working for me this: resources :Cars match 'color/:color' => 'cars#index' match 'brand/:brand' => 'cars#index' match 'brand/:brand/color/:color' =

[Rails] Re: NEW PROJECT - different render depending of browser / multilingual site

2011-05-08 Thread satishnk...@googlemail.com
good to use Ruby on Rails...and if you want to render different page..then use the application controller and in it use a before filter to identify the request object and finally get the browser from the request Regards Satish N Kota On May 6, 11:43 am, Quijote70 wrote: > Hi All, > > I'm prepari

Re: [Rails] (Beginner) Finding a database object within a time interval

2011-05-08 Thread Colin Law
On 8 May 2011 13:58, Anders_P wrote: > Hello, > > I'm trying to create a find statement that should find an element > which start_date and end_date are within Time.now. If I for example > have an object with a start_date of 2011-05-04 and end_date of > 2011-05-19, the find statement should find th

[Rails] (Beginner) Finding a database object within a time interval

2011-05-08 Thread Anders_P
Hello, I'm trying to create a find statement that should find an element which start_date and end_date are within Time.now. If I for example have an object with a start_date of 2011-05-04 and end_date of 2011-05-19, the find statement should find the elment(s) that are within that time peroid. My

Re: [Rails] Re: changing routes.rb

2011-05-08 Thread Colin Law
On 8 May 2011 13:46, Mohamed L. wrote: > Yeah I had changed to root :to=> and restarted the server. > > Ok, my routes.rb= > > Debate::Application.routes.draw do >  resources :posts > ... >  # You can have the root of your site routed with "root" >  # just remember to delete public/index.html. >  #

[Rails] Re: changing routes.rb

2011-05-08 Thread Mohamed L.
Yeah I had changed to root :to=> and restarted the server. Ok, my routes.rb= Debate::Application.routes.draw do resources :posts get "home/index" # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match 'products/:id'

Re: [Rails] Re: Re: changing routes.rb

2011-05-08 Thread Colin Law
On 8 May 2011 12:31, Mohamed L. wrote: > David Kahn wrote in post #997316: >> On Sat, May 7, 2011 at 9:27 PM, Mohamed L. wrote: >> >>> Hey, I'm trying to sort out the routing still, I've generated a home >>> controller, deleted the public/index.html and changed the routes.rb to >>> have :root to=

[Rails] Re: Re: changing routes.rb

2011-05-08 Thread Mohamed L.
David Kahn wrote in post #997316: > On Sat, May 7, 2011 at 9:27 PM, Mohamed L. wrote: > >> Hey, I'm trying to sort out the routing still, I've generated a home >> controller, deleted the public/index.html and changed the routes.rb to >> have :root to=> "home#index" and I have changed the html code

Re: [Rails] Constants and Configurations

2011-05-08 Thread Colin Law
On 8 May 2011 11:08, Tiago Veloso wrote: > Hi, > > Right now I have some Constants in my application that serve as > configurations for my application. I would like to make these > configurations "editable" by the users/admins through views. > > What is the best strategy to do this? Put them in t

Re: [Rails] Re: save query string parameter value to database

2011-05-08 Thread Colin Law
On 8 May 2011 10:32, farhad mahmoodi wrote: > this is correct: > http://simple-beach-416.heroku.com/code/restserver?fn=p1&ln=p2 Again, you must ask a question if you want help. All I see is the 'something went wrong' message at that url. This comes from your file public/500.html in your applic

[Rails] Constants and Configurations

2011-05-08 Thread Tiago Veloso
Hi, Right now I have some Constants in my application that serve as configurations for my application. I would like to make these configurations "editable" by the users/admins through views. What is the best strategy to do this? -- You received this message because you are subscribed to the Goo

[Rails] Re: save query string parameter value to database

2011-05-08 Thread farhad mahmoodi
this is correct: http://simple-beach-416.heroku.com/code/restserver?fn=p1&ln=p2 -- 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-talk@googlegroups

Re: [Rails] WEBrick sending wrong http status code?

2011-05-08 Thread Frederick Cheung
On 8 May 2011, at 04:51, Michael Hanna wrote: > Testing my login page, when I POST the wrong password I should expect > a 401 Unauthorized http status code back. Here is the session#create > controller method where I use :status => :unauthorized (using > sproutcore, so I'm returning JSON): >

Re: [Rails] Re: changing routes.rb

2011-05-08 Thread Colin Law
On 8 May 2011 03:27, Mohamed L. wrote: > Hey, I'm trying to sort out the routing still, I've generated a home > controller, deleted the public/index.html and changed the routes.rb to > have :root to=> "home#index" and I have changed the html code in > app\view\home\index It should just be root, n

[Rails] Re: Activerecord::JDBCError: Invalid column number

2011-05-08 Thread Klaus Humme
Okay, I've choesen an other table with only 11 columns and listed them all: class MandateFile < ActiveRecord::Base # fix non-standard table and primary key name conventions set_table_name :AZLOELOG set_primary_key :D_AZLOGNR alias_attribute :id, :D_AZLOGNR alias_attribute :annotext_az