[Rails] Re: Raise Exception in Non Active Record Model

2010-03-06 Thread Smart RoR
Seems Controller Exception Handling kicks in as usual. Wanted to avoid as this is part of JS AJAX request. -- 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 rub

[Rails] Rails development processes running very slow

2010-03-06 Thread Alex
This is a problem I know other people have been having. I'm on Rails 2.3.5 on a dual core 2.1Ghz Macbook Pro 2.1 with 3Gb of ram and 800Mb+ inactive memory. Things should be fast. Sometimes things run slowly, but nothing nearly as slowly as rails. irb starts in milliseconds. Even Java maven tas

[Rails] Collection_select with has_one association

2010-03-06 Thread Greg Ma
Hi, I try to create a select menu with all the city available in my shop form. I've been able to populate the select menu but the city_id isn't stored in the shop table. There must be an error in my view regarding that i'm not sure to understand each parameters of the collection_select. Shop.rb c

[Rails] Re: Static HTML in XML Builder or otherwise; With Dynamic Se

2010-03-06 Thread Smart RoR
Robert Walker wrote: > Smart RoR wrote: >> Best way to display HTML file as text or xml where some parts are >> dynamic? > > I really don't understand what you're trying to do there. How is what > you are describing any different than standard ERB templates. They are > static HTML with some dyna

[Rails] Mocha expectation is affecting (bleeding) from one test to another

2010-03-06 Thread Ease Bus
Mocha expectation is affecting (bleeding) from one test to another: In one test, I have: Friendship.expects(:is_friend?).with(users[1], users[3]).returns(true) Then, in another test, which actually is listed before the test, I am getting this error: unexpected invocation: Friendship(id: integer,

[Rails] Re: Static HTML in XML Builder or otherwise; With Dynamic Se

2010-03-06 Thread Robert Walker
Smart RoR wrote: > Best way to display HTML file as text or xml where some parts are > dynamic? I really don't understand what you're trying to do there. How is what you are describing any different than standard ERB templates. They are static HTML with some dynamic parts. > So we have a Static

Re: [Rails] datatype error in ROR

2010-03-06 Thread Conrad Taylor
On Sat, Mar 6, 2010 at 8:03 PM, mamathahl wrote: > > Conrad, > The data type of l.lat and l.lng are same as that of lat_rad and lng_rad. > They are declared as follows: > > t.decimal :lat, :precision => 15, :scale => 10 > t.decimal :lng, :precision => 15, :scale => 10 > > The following lines ar

Re: [Rails] namespaced controller question

2010-03-06 Thread Craig White
On Sun, 2010-03-07 at 04:57 +0100, Phillip Koebbe wrote: > I have a utility controller that has an action in it. Before I changed > to namespaced controllers, I could access the action with: > > /utility/my_action > > There are no resources associated with the controller, so I'm assuming > the st

[Rails] namespaced controller question

2010-03-06 Thread Phillip Koebbe
I have a utility controller that has an action in it. Before I changed to namespaced controllers, I could access the action with: /utility/my_action There are no resources associated with the controller, so I'm assuming the stock route map.connect ':controller/:action/:id' picked it up. However

Re: [Rails] datatype error in ROR

2010-03-06 Thread mamathahl
Conrad, The data type of l.lat and l.lng are same as that of lat_rad and lng_rad. They are declared as follows: t.decimal :lat, :precision => 15, :scale => 10 t.decimal :lng, :precision => 15, :scale => 10 The following lines are within the controller file named items_controller.rb t.lat_ra

[Rails] Re: Raise Exception in Non Active Record Model

2010-03-06 Thread Smart RoR
Smart RoR wrote: > Hi There: > > If I raise an exception in a Non Active Record Model object on call from > Controller that extends from ApplicationController, what are the best > ways to show it on the view side as an error? > > > Thanks much. I raise exception in Non Active Record Model. I th

[Rails] Raise Exception in Non Active Record Model

2010-03-06 Thread Smart RoR
Hi There: If I raise an exception in a Non Active Record Model object on call from Controller that extends from ApplicationController, what are the best ways to show it on the view side as an error? Thanks much. -- Posted via http://www.ruby-forum.com/. -- You received this message because yo

Re: [Rails] t0_r0 from include, is it bad?

2010-03-06 Thread Jeremy Kemper
On Sat, Mar 6, 2010 at 3:38 PM, Fernando Perez wrote: > Some of my queries that have includes get generated with t0_r0. Is it > something to avoid? It's completely normal. It's how Active Record doing some bookkeeping to find with :include. jeremy -- You received this message because you are s

[Rails] Connecting to sessions table in another database

2010-03-06 Thread tispratik
I have two applications, appA and appB. I want to use single sign on for both the apps. Meaning, if a user logs in to appA, he dont have to login to appB and conversely, if a user logged out of appA, it logs him out of appB too. Just like in google's various products. I created the sessions table

[Rails] Re: Weird install problems

2010-03-06 Thread Eric B.
Eric B. wrote: > I am new to RoR, and I am just starting out, but I am having massive > problems doing what should be a painless install. I am running a windows > machine and I have ruby installed as well as gems. > > When I try to do the command > gem install rails > I get > > c:\Ruby19>gem inst

Re: [Rails] datatype error in ROR

2010-03-06 Thread Conrad Taylor
On Sat, Mar 6, 2010 at 4:39 PM, mamathahl wrote: > > I have been facing some problem with the datatypes. I have a sample of > code > as follows. > > t.lat_rad = (l.lat * BigDecimal.new("3.1415926536 / 180")).to_f > t.lng_rad = (l.lng * BigDecimal.new("3.1415926536 / 180")).to_f > > Initially,

[Rails] datatype error in ROR

2010-03-06 Thread mamathahl
I have been facing some problem with the datatypes. I have a sample of code as follows. t.lat_rad = (l.lat * BigDecimal.new("3.1415926536 / 180")).to_f t.lng_rad = (l.lng * BigDecimal.new("3.1415926536 / 180")).to_f Initially, the datatype of lat_rad and lng_rad was as follows: t.decimal

[Rails] t0_r0 from include, is it bad?

2010-03-06 Thread Fernando Perez
Hi, Some of my queries that have includes get generated with t0_r0. Is it something to avoid? -- 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..

[Rails] How to configure nested routers to omit controller from URL?

2010-03-06 Thread Steve Wilhelm
I have the following nested route in my routes.rb map.resources :users do |user| user.resources :pie_charts end and the 'rake routes' command shows the following routes: user_pie_charts GET /users/:user_id/pie_charts(.:format) {:controller=>"pie_charts", :action=>"index"} user_pie_chart

[Rails] Weird install problems

2010-03-06 Thread Eric B.
I am new to RoR, and I am just starting out, but I am having massive problems doing what should be a painless install. I am running a windows machine and I have ruby installed as well as gems. When I try to do the command gem install rails I get c:\Ruby19>gem install rails ERROR: While executing

Re: [Rails] [slightly OT] Grokking agile practices

2010-03-06 Thread Jeffrey L. Taylor
Quoting Phoenix Rising : > I'm somewhat of a newbie to agile practices, and I know the Rails > community in general is pretty "up to speed" on agile methodologies, > but if there's a better place for me to ask this question, let me > know, and forgive the off topic post. > So I understand your si

Re: [Rails] Re: form_for, submit, and parameters disappearing

2010-03-06 Thread Colin Law
On 6 March 2010 18:50, Ralph Shnelvar wrote: > Consider the following: > > - - - > <% form_for @countryToSearchFor, :url => signed_in_path(:action => > "show", >        :id => 'connected_to_country', :something => 'other'), >        :html => {:method => :get} do |f| %> > >  <%= f.select :country,

[Rails] Re: fastercsv and associated records

2010-03-06 Thread harm
On Mar 6, 6:00 pm, Frederick Cheung wrote: > >       Rate.find_or_create_by_name( > >         :provider => lambda { > >                      Provider.find_by_name(row['Provider_Name']) }, > >         :name => row['Rate_Name'], > >         :preis => row['Preis'] > >         ) > >     end > >   end

[Rails] Re: Extending a Model that is in a plugin

2010-03-06 Thread Maher Hawash
I have the same issue. Have you been able to figure it out? Thanks, Maher -- 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.

Re: [Rails] Re: Re: Re: Why all columns of joined table get instantiated as String?

2010-03-06 Thread Michael Pavling
On 6 March 2010 17:49, Jack Shanter wrote: > The real "books" and "pages" have decimal and large text columns that > are not always needed. Could be worth considering extracting those fields into another table and have a 1:1 link... a little messy, but saves you returning lots of data when you on

[Rails] Re: form_for, submit, and parameters disappearing

2010-03-06 Thread Ralph Shnelvar
Consider the following: - - - <% form_for @countryToSearchFor, :url => signed_in_path(:action => "show", :id => 'connected_to_country', :something => 'other'), :html => {:method => :get} do |f| %> <%= f.select :country, language_neutral_array_of_countries, :prompt => 'e

[Rails] searching method.

2010-03-06 Thread Manish Belsare
def search if params[:q] query = params[:q] # First find the user hits... @users = User.find_by_contents(query, :limit => :all) # ...then the subhits. personals = Personal.find_by_contents(query, :limit => :all) #flash[:notice] = personals.size faqs = Faq.find_by_cont

[Rails] form_for, submit, and parameters disappearing

2010-03-06 Thread Ralph Shnelvar
Consider the following: -- 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 ruby

[Rails] Is there any developer from Bangladesh here?

2010-03-06 Thread Alimul Razi
Looking forward to meet Bangladeshi Ruby developers. Please response. I need 3 developers. Its argent. -- 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

[Rails] [JOBS] Launch Interactive Media Needs a PM and 3 developers.

2010-03-06 Thread Alimul Razi
If you are staying in Bangladesh and you are a Ruby on Rails expert please reply to this email or contact here. Alimul Razi, Development Manager, Launch Interactive media, Mahakhali, Dhaka Mobile: 8801713377455 Email: alim...@gmail.com -- You received this message because you are subscribed to

[Rails] Re: Re: Re: Why all columns of joined table get instantiated as String?

2010-03-06 Thread Jack Shanter
Rick Denatale wrote: > Then just change the joins to include: > > Page.all( > :include => :book, > :conditions => ["books.library_id = ?", 1] > ) > > Which will both allow you to refer to the books fields in the where > clause, and return an collection of object graphs rather than page > object

Re: [Rails] Trying to figure out if this is a helper or a controller or a partial?

2010-03-06 Thread Jeffrey L. Taylor
Quoting Jeffrey L. Taylor : > Quoting John Goewert : > > I have an app that I am trying to generate out some GoogleMaps. The > > GoogleMaps aren't the problem, I am tripping over the proper way to > > handle what I want to do. > > > > I have a DB for map markers. > > > > Path 1: > > When the user

[Rails] Re: fastercsv and associated records

2010-03-06 Thread Frederick Cheung
>       Rate.find_or_create_by_name( >         :provider => lambda { >                      Provider.find_by_name(row['Provider_Name']) }, >         :name => row['Rate_Name'], >         :preis => row['Preis'] >         ) >     end >   end > end > > But the association-key (provider_id) in the tab

[Rails] fastercsv and associated records

2010-03-06 Thread harm
Hi, I try to import data with a rake-task from a csv-file into a model like: provider, which has_many :rates and rate, which belong_to: provider I do the following: namespace :db do desc "load data from csv" task :load_csv_data => :environment do require 'fastercsv' FasterCSV.for

Re: [Rails] Trying to figure out if this is a helper or a controller or a partial?

2010-03-06 Thread Jeffrey L. Taylor
Quoting John Goewert : > I have an app that I am trying to generate out some GoogleMaps. The > GoogleMaps aren't the problem, I am tripping over the proper way to > handle what I want to do. > > I have a DB for map markers. > > Path 1: > When the user makes a call to the controller => "mymap", ac

[Rails] as_json for arrays?

2010-03-06 Thread Michal Burak
Hi. The file /rails/activesupport/lib/active_support/json/encoders/enumerable.rb Has: class Array (...) def as_json(options = nil) #:nodoc: self end end I want a as_json method FooModel.all.as_json(:only => [...]) that will work same as FooModel.first.as_json(:only => [...]). I had t

Re: [Rails] Re: RegEx help to detect First and Last name

2010-03-06 Thread Rick DeNatale
On Fri, Mar 5, 2010 at 10:06 PM, Allan Last wrote: > Thanks for the suggestions. I'm going to play around with this. > > On the most part, I'm doing detection for scenarios with two names, so > names like Robert De Niro will not come up. I'm pretty sure, though that the actor would say he HAD two

[Rails] Simulate activity of users?

2010-03-06 Thread Heinz Strunk
Hello, I've got a web application that should simulate different activities as follows: - User1 and User2 teamed up for an activity called Activity1. - Users have skills: skill1, skill2 def simulate_activity a = Activity.find(params[:id]) return execute_1 a if a.activity_type == "1" return

Re: [Rails] Trying to figure out if this is a helper or a controller or a partial?

2010-03-06 Thread Colin Law
On 5 March 2010 21:56, John Goewert wrote: > I have an app that I am trying to generate out some GoogleMaps. The > GoogleMaps aren't the problem, I am tripping over the proper way to > handle what I want to do. > > I have a DB for map markers. > > Path 1: > When the user makes a call to the contro

[Rails] Getting many to many polymorphic associations to work as advertised...

2010-03-06 Thread tribalvibes
Could anyone please help? Getting exceptions trying to implement: module P class List < ActiveRecord::Base has_many :list_items has_many :items, :through => :list_items has_many :contacts, :source => :item, :through => :list_items, :source_type => "P::Contact" has_many :users, :

[Rails] Trying to figure out if this is a helper or a controller or a partial?

2010-03-06 Thread John Goewert
I have an app that I am trying to generate out some GoogleMaps. The GoogleMaps aren't the problem, I am tripping over the proper way to handle what I want to do. I have a DB for map markers. Path 1: When the user makes a call to the controller => "mymap", action => "show", I grab the id parameter

[Rails] Re: Restful-authentication plugin for rails3

2010-03-06 Thread Simone R.
John Wu wrote: > Hi, > > I just installed Restful-authentication plugin and tried > rails g authenticated user sessions > and got Could not find generator authenticated. > > What is the problem? > > Thanks I donn't kow about restful-authentication and Rails3 compatibility but maybe this page