[Rails] Re: ActionController::UnknownAction

2011-01-16 Thread Anju P s
I resolved the issue It was a PEBKAC, accidentally I defined my method under a set of private methods :(. Thanks David David White wrote in post #974243: > The only suggestion I can think of is to check there's no private or > protected call on any of the lines above the method name or to check

[Rails] Rails 3: Using local timezone on DB

2011-01-16 Thread Sean Tan
I'm in the process of upgrading my existing Rails 2.3.8 app to Rails 3.0.3. One problem that I have encountered is how to make rails 3 read/write date/time data into the DB in localtime. In Rails 2.3.8, commenting out the ActiveRecord timezone settings did the trick, however in Rails 3, that does

[Rails] Form action not sending to create action

2011-01-16 Thread Dhruv G.
hi all, I'm trying to set up a simple form and getting some odd behavior in the resulting action. Following is my code for the form: <% form_for @user_session do |f| %> <%= render 'shared/error_messages', :object => f.object %> <%= f.label :email %> <%= f.text_field :email %>

[Rails] Re: [RVM,Ubuntu]ruby installed from rvm doesn't work

2011-01-16 Thread Sean Tan
I'm using CentOS 5.5 and typing rvm notes it gave specific instruction to install mri 1.8.7 before 1.9.2. i.e. rvm install 1.8.7 rvm use 1.8.7 rvm install 1.9.2 This worked for me. here's a copy/paste from my rvm notes: Notes for Linux ( CentOS release 5.5 (Final) ) NOTE: 'ruby' repre

[Rails] Re: Fwd: Java vs. RoR

2011-01-16 Thread Me
haaa, ya at the bookstore there is about 3 full shelves of java crap, and half to 3/4 of a shelf of rails/ruby books. -- 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.com.

[Rails] Re: Java vs. RoR

2011-01-16 Thread rajeevsharma86
:)) On Mon, Jan 17, 2011 at 10:34 AM, shyam wrote: > > > >> [image: java-ror.jpg] >> > > > > Thanks and regards, > Shyam Mohan > Ruby on rails developer > Mobile : +91-86884-68400 > Web : shyam.heroku.com > -- Thanks: Rajeev sharma -- You received this message because you are subscribed t

Re: [Rails] Re: text box value in the confirmation popup

2011-01-16 Thread Me
ya is this correct? -- 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.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. F

Re: [Rails] Re: text box value in the confirmation popup

2011-01-16 Thread Walter Lee Davis
On Jan 16, 2011, at 11:24 PM, Me wrote: Actually what I posted is what rails produces, I copied the javascript from the page source. I was more interested how to get the div id value into the string, is it a quote issue? Oh, sorry I missed that. If you have Prototype in your page, then th

Re: [Rails] Re: text box value in the confirmation popup

2011-01-16 Thread Me
Actually what I posted is what rails produces, I copied the javascript from the page source. I was more interested how to get the div id value into the string, is it a quote issue? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To pos

Re: [Rails] Re: text box value in the confirmation popup

2011-01-16 Thread Walter Lee Davis
On Jan 16, 2011, at 7:23 PM, Me wrote: Ok I am doing it the manual way, how do I get the value to show up? Are the quotes correct? The simplest way to do the return true/false stuff is: ... The return false (which happens if the confirm is cancelled) stops the form submission directl

Re: [Rails] Re: tracking the shopping cart for an unregistered user

2011-01-16 Thread Hassan Schroeder
On Sun, Jan 16, 2011 at 4:30 PM, Bharat Ruparel wrote: > My question was more about how to track an anonymous user across > sessions reliably. Semi-reliably: set a persistent cookie with the session/cart id. -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hass

[Rails] Re: tracking the shopping cart for an unregistered user

2011-01-16 Thread Me
You could assign each session a random number for each one. -- 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.com. To unsubscribe from this group, send email to rubyonrail

[Rails] Re: ActionController::RoutingError (undefined method `has_many' for

2011-01-16 Thread cthorner
Thanks On Jan 16, 4:11 am, Frederick Cheung wrote: > On Jan 16, 9:28 am, cthorner wrote: > > > on that line I have > > has_many :children > > > I have a corresponding belongs_to line in the ChildrenController > > class. > > > I am not trying to do anything fancy here, just establishing a simple

[Rails] Re: Re: persistence by reachability

2011-01-16 Thread Vogon Primo
Richard Ramsden wrote in post #975325: > Hey Vogon, > > You should check out the autosave feature in ActiveRecord. I think this > is > what you're looking for :) > http://api.rubyonrails.org/classes/ActiveRecord/AutosaveAssociation.html > > Cheers, > Richard > > On Sun, Jan 16, 2011 at 11:08 AM, Fr

[Rails] Re: tracking the shopping cart for an unregistered user

2011-01-16 Thread Bharat Ruparel
Hello Chris, Thanks for the response. Yes it is a good idea to expire this kind of session data. My question was more about how to track an anonymous user across sessions reliably. The only thing that I can think of is doing this based on the IP address which can be unreliable? What if there

[Rails] Re: persistence by reachability

2011-01-16 Thread Vogon Primo
Thanks for reply Frederick, What I wrote is really obscure, so let me explain: replacing the name 'graph' with farmer, imagine a situation where in the database there is a record that I retrieve with : farmer = Farmer.find(2) Well, this farmer has many cows associated, and these cows are

[Rails] Re: text box value in the confirmation popup

2011-01-16 Thread Me
Ok I am doing it the manual way, how do I get the value to show up? Are the quotes correct? -- 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.com. To unsubscribe from t

[Rails] Re: redgreen unittest with Rails 3 + Ruby 1.9.2

2011-01-16 Thread djangst
Sean, You're right, and that's confirmed here: http://rubygems.org/gems/turn "If you have the 'ansi' gem installed, then TURN output will be displayed in wonderful technicolor..." So have 'ansi' installed and just reference "gem 'turn'": # Gemfile group :development, :test do gem 'turn' end

[Rails] storing large string from browser

2011-01-16 Thread Mike
Hi, I'm getting XML data from a plugin using client side Javascript and attempting to get it stored off on the server. My first attempt was updating the value of a hidden form field then storing it away in a model/table from the controller upon post/put. It turns out the data frequently takes up

[Rails] Re: tracking the shopping cart for an unregistered user

2011-01-16 Thread Me
I would probably make that kind of session expire quickly and add a method to remove that from the db after a certain time period. I have a prod app that I am working on fora company that keeps the sessions in the db and we wrote a task that deletes all session older than like 90 days I think o

[Rails] tracking the shopping cart for an unregistered user

2011-01-16 Thread Bharat Ruparel
What is a good way to track the shopping cart for an unregistered user? For a user session it is easy, but what if the user logs in, adds a few items in the cart, and decides to terminate the session and then returns later? What are some of the design trade-offs? Bharat -- Posted via http://www.

Re: [Rails] Javascript call in Controller

2011-01-16 Thread Fernando Leandro
Hello, Because i need to get the content of a div in the page. I need to do this var currentEvents = jQuery(".wc-cal-event"); currentEvents.each(function(index, element) { var calEvent = jQuery(this).data("calEvent"); alert(calEvent.start); alert(c

Re: [Rails] Re: persistence by reachability

2011-01-16 Thread Richard Ramsden
Hey Vogon, You should check out the autosave feature in ActiveRecord. I think this is what you're looking for :) http://api.rubyonrails.org/classes/ActiveRecord/AutosaveAssociation.html Cheers, Richard On Sun, Jan 16, 2011 at 11:08 AM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > >

Re: [Rails] Javascript call in Controller

2011-01-16 Thread Colin Law
On 16 January 2011 22:14, Fernando Leandro wrote: > Hello guys, > > I would like to know if i can call a javascript function directly from my > controller and get the return of the function. No, the controller is written in Ruby and runs on the server. Javascript runs in the browser. Why do you

[Rails] Re: Re: Extremely slow start up with ruby 1.9.1 vs 1.8.7

2011-01-16 Thread Micah Geisel
Jp Jphpsf wrote in post #975316: > Also, with rvm, I think I can install ruby from head, see if it improves > the performance problem. I've installed ruby-head via rvm, and updated my gist. It does seem to be an improvement! Still lagging behind ree, though. https://gist.github.com/756616 -- Po

[Rails] Re: Problem with displaying my XML response from API in view

2011-01-16 Thread Tim
Hi Fred! The bit wich fetches the xml and parses it I have done a regular puts on that many times and i did 'var local' in debugger mode which displayed all local variables and then I got all the xml output. Before I did the debugging actually before it has been set. Im trying to do it after now a

[Rails] Re: Re: Extremely slow start up with ruby 1.9.1 vs 1.8.7

2011-01-16 Thread Jp Jphpsf
Conrad Taylor wrote in post #975240: > Hi, in order to put your numbers below into context, can you post the > spec for your hardware? > > Thanks, > > -Conrad > I was running the test on my laptop (core 2 duo 1.86ghz + 2gb ram + 5400rpm hdd). I might run the same test on my desktop (quad core 3.2

[Rails] Re: Problem with displaying my XML response from API in view

2011-01-16 Thread Frederick Cheung
On Jan 16, 8:54 pm, Tim wrote: > How is this possible? I might be new to ruby and rails but Im feeling > really lost. Any good feedback?! > Thanks! > Are you inspecting the variable before or after it has been set? Have you tried refactoring the bit which fetches and parses the xml feed into it

[Rails] Re: Problem with displaying my XML response from API in view

2011-01-16 Thread Tim
I finally managed to debug more around the @stories variable. This is an outtake from it (rdb:14) display @stories 1: @stories = (rdb:14) show @stories Unknown show command @stories (rdb:14) p @stories nil (rdb:14) pp stories NameError Exception: undefined local variable or method `stories' for # (

[Rails] [ANN] sqlite3 1.3.3 Released

2011-01-16 Thread Aaron Patterson
sqlite3 version 1.3.3 has been released! * * * * This module allows Ruby programs to interface with the SQLite3 database engine

[Rails] Re: Problem with displaying my XML response from API in view

2011-01-16 Thread Tim
Colin! I did this in debugger mode. display @stories 1: @stories = It seems as though he object is empty? As i suspected. I cant understand how it can be when I am declaring it with the doc container which should contain the api url?? Very confusing this. Im trying to invoke the debugger around thi

[Rails] Re: Re rendering a page with an additional Param

2011-01-16 Thread Cameron Vessey
Frederick Cheung wrote in post #975249: >> > That's pretty much exactly what you'd do (or you might want to add the > condition on qty into what fetches tries from the database) > > Fred Thanks for letting me know I was on the right track. -- Posted via http://www.ruby-forum.com/. -- You recei

[Rails] Re: persistence by reachability

2011-01-16 Thread Frederick Cheung
On Jan 16, 3:28 pm, Vogon Primo wrote: >  graph = Farmer.find(x) # Retrieves four cows of x > >  graph.cows[1].name = "Trottolina" > >  graph.save > >  while adding a new cow to collection works perfectly fine, ActiveRecord > doesn't update for reachability the associated record why? What do y

[Rails] Re: text box value in the confirmation popup

2011-01-16 Thread Frederick Cheung
On Jan 16, 4:59 pm, Me wrote: > Is there no way to assign the val to a var and just putting it in the > string? not the way submit_tag generates it's javascript. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, s

[Rails] Re: text box value in the confirmation popup

2011-01-16 Thread Me
I had this originally: %= @deposit = javascript_tag "$('funding_transaction_deposit').innerHTML" %> <%= submit_tag 'Create', :confirm => "Are you sure you would like #{@deposit} dibits deposited?" %> -- You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: text box value in the confirmation popup

2011-01-16 Thread Me
Is there no way to assign the val to a var and just putting it in the string? -- 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.com. To unsubscribe from this group, send em

Re: [Rails] Re: Extremely slow start up with ruby 1.9.1 vs 1.8.7

2011-01-16 Thread Luke Cowell
This issue in 1.9.2 was affecting me enough that I switched back to 1.8.7, but not without doing a bit of research in to what the problem was. We see a performance loss in 1.9.2 as it exhibits the correct behaviour when calling require, whereas 1.8.7 is reliant on incorrect semantics that are no

[Rails] Seeking talks on Rails plugins to be presented at Red Dirt RubyConf

2011-01-16 Thread ThirtySixthSpan
We are seeking talks on Rails addons and plugins at Red Dirt RubyConf this year in our Rails Extensions track. If anyone is interested in proposing a talk, our CFP is now open. --- We are really pleased to announce the second annual Red Dirt RubyConf to be help April 21st and 22nd, 2010 in Oklaho

[Rails] Re: Adaptive Learning for Ruby on Rails

2011-01-16 Thread Arailsdemo A.
It seems to me that it would be hard to target users with such a wide range of experiences (beginner to expert). I'm not familiar with adaptive learning techniques, but if I'm a moderate level user, I wouldn't want to sit through too much beginner level stuff to get through to the more advanced

[Rails] Re: Best practice for root?

2011-01-16 Thread Heinz Strunk
Working like a charm already, thanks a lot! -- 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.com. To unsubscribe from this group

[Rails] persistence by reachability

2011-01-16 Thread Vogon Primo
Hello guys, I have these models class Farmer < ActiveRecord::Base has_many :cows end class Cow < ActiveRecord::Base set_table_name :cows belongs_to :farmer end ... graph = Farmer.find(x) # Retrieves four cows of x graph.cows[1].name = "Trottolina" graph.save while ad

[Rails] Re: Rails 3, RSpec, Factory Girl results in NameError: uninitialized constant

2011-01-16 Thread Heinz Strunk
Yeah, just figured that out. Didn't know FactoryGirl was so strict about it. That one worked: Factory.define :video do |f| f.title "MyString" f.teaser "MyText" f.link "MyString" end Thanks! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribe

[Rails] Re: Rails 3, RSpec, Factory Girl results in NameError: uninitialized constant

2011-01-16 Thread Arailsdemo A.
Did you create your VideoOne model yet? FactoryGirl requires that this be present. Here's some general background on FactoryGirl http://www.arailsdemo.com/posts/39. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby o

[Rails] Redmine with Bitnami stack beginner question

2011-01-16 Thread Gerő Zoltán
Hi all, just installed Bitnami's Redmine stack on Ubuntu. I followed the Readme but something I must miss. 1. How to start the server? output for "./ctlscript.sh start" /home/vadkant/redmine-1.1.0-0/mysql/scripts/ctl.sh : mysql (pid 8192) already running starting port 3001 starting port 3002 Sy

Re: [Rails] Re: Best practice for root?

2011-01-16 Thread Fidel Viegas
On 16/01/11 11:23, Heinz Strunk wrote: Yes it does, thanks Fidel! Hi Hanz, Also don't forget to create a route in your routes.rb file. In Rails 3, you map it like this: root :to => "home#index" In prior versions you do it like this: map.root :controller => "home", :action => "index" This

[Rails] Re: Rails 3, RSpec, Factory Girl results in NameError: uninitialized constant

2011-01-16 Thread Heinz Strunk
I just tried the console and same error occurs: ruby-1.9.2-p136 :016 > Factory.define :blah do |f| f.name "dasd"; f.email "blsd...@fdk.de" end => #, #]> ruby-1.9.2-p136 :017 > Factory(:blah) NameError: uninitialized constant Blah from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2

[Rails] Re: redgreen unittest with Rails 3 + Ruby 1.9.2

2011-01-16 Thread Sean Tan
Just an update, I noticed that things seem to work fine without the 'term-ansicolor' gem. -- 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@g

[Rails] Re: Before and After Filters/Functions for Rails Routes

2011-01-16 Thread Oguz Bilgic
here is the link for stackoverflow version http://stackoverflow.com/questions/4705304/before-and-after-filters-functions-for-rails-routes -- 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

[Rails] Before and After Filters/Functions for Rails Routes

2011-01-16 Thread Oguz Bilgic
Hi I have an idea and I am not sure if is is already done.Right now to make url search engine friendly developers use to_param function of model class. Then they call to_s function to get the id of the elmenet. What if I want to create url for not model but for string. Lets say I create link fo

[Rails] Re: Re rendering a page with an additional Param

2011-01-16 Thread Frederick Cheung
On Jan 14, 11:36 pm, Cameron Vessey wrote: > Chris Habgood wrote in post #974783: > > > You can just pass it into the view as a hidden param. > > like a session variable or some thing? I'd avoid session variables. > > Well I was thinking that maybe I could build a route that went > controller/a

[Rails] Re: text box value in the confirmation popup

2011-01-16 Thread Frederick Cheung
On Jan 14, 9:29 pm, David Kahn wrote: > On Thu, Jan 13, 2011 at 6:46 PM, Me wrote: > > kinda hung here I have this and I am getting js in the popup. > > > <%= @deposit = javascript_tag "$('funding_transaction_deposit').innerHTML" > > %> > >   > >     <%= submit_tag 'Create', :confirm => "Are y

[Rails] Re: ActionController::RoutingError (undefined method `has_many' for

2011-01-16 Thread Frederick Cheung
On Jan 16, 9:28 am, cthorner wrote: > on that line I have > has_many :children > > I have a corresponding belongs_to line in the ChildrenController > class. > > I am not trying to do anything fancy here, just establishing a simple > one to many relationship. Any suggestions as to what I might b

[Rails] Re: nube-Simple Question

2011-01-16 Thread Frederick Cheung
On Jan 16, 2:14 am, "John S." wrote: > I want to collect a value and then use the value to edit the record, I > have so far: > >  TAG number on tree: >  <%= text_field_tag 'treetag' %> > > <%=link_to "Edit", :controller => "inventory", :action => "edit",  :id > => 5%> > > I need to get the value

[Rails] ActionController::RoutingError (undefined method `has_many' for

2011-01-16 Thread cthorner
I am getting an error with Rails 3.0.3 ActionController::RoutingError (undefined method `has_many' for ParentsController:Class): app/controllers/parents_controller.rb:3 on that line I have has_many :children I have a corresponding belongs_to line in the ChildrenController class. I am not trying

[Rails] Rails 3, RSpec, Factory Girl results in NameError: uninitialized constant

2011-01-16 Thread Heinz Strunk
Hi people, I'm having a little trouble getting spec to run with Factory Girl on my new Rails 3 app. /spec/spec_helper.rb: # This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require '

[Rails] Re: Learning Rails wth tutorial - can't push to Heroku

2011-01-16 Thread gezope
Oh yes, he's right, forgot to ask: do you have Sqlite3 gem itself? The way is: 1. Right version of Ruby, Gem, Rails installed - hopefully with Ruby Version Manager http://rvm.beginrescueend.com/ . You can try these from terminal: "ruby -v" "rails-v" "gem -v" (If you have further problems please w

Re: [Rails] Re: Extremely slow start up with ruby 1.9.1 vs 1.8.7

2011-01-16 Thread Conrad Taylor
Hi, in order to put your numbers below into context, can you post the spec for your hardware? Thanks, -Conrad Sent from my iPhone On Jan 15, 2011, at 6:36 PM, Jp Jphpsf wrote: > Count me in :/ > > On ubuntu 10.10 with ruby 1.9.2 and a fresh rails 3.0.3. I created a > cucumber feature with o

[Rails] Re: Best practice for root?

2011-01-16 Thread Heinz Strunk
Yes it does, thanks Fidel! -- 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.com. To unsubscribe from this group, send email to

Re: [Rails] Best practice for root?

2011-01-16 Thread Fidel Viegas
On 16/01/11 09:34, Heinz Strunk wrote: Good morning, I just started a new application and was wondering what the best practice for root (-> http://localhost:3000/) is. My landing page is going to load data from 5 different models and I don't really know if I should put a "welcome" action in one

[Rails] Best practice for root?

2011-01-16 Thread Heinz Strunk
Good morning, I just started a new application and was wondering what the best practice for root (-> http://localhost:3000/) is. My landing page is going to load data from 5 different models and I don't really know if I should put a "welcome" action in one of these 5 controllers or create somethin