[Rails] search function implimentaion with the tag name as the search box entry

2008-12-09 Thread srikanth
hi i am implimenting the search function using tags. i have tables called streams and tags. each entry of the table have a single or multiple tagnames(i am using acts_as_taggable_on_steroids for tagging). streams table and correspong tagname to the table entries given below name reso

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Rohith Nair
Thanks for that tooo Now i did one cmd command "rake db:create:all" Its shows like Only modify the local one. U cant do the current database remoteHost -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are su

[Rails] Re: getting a real int from DB

2008-12-09 Thread Mickael Faivre-Macon
No problem, I'll do with it :) Thanks for this explanation. MIckael. Frederick Cheung wrote: > When you pick attributes not from the base table (in this case > projects) rails will handle things as strings. Maybe not what one > would hope for, but it's the way things are right now. > > Fred --

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Rohith Nair
Thanks for that.. Can u help me out with some more links??? -- 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

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Air [EMAIL PROTECTED]
also http://www.tutorialspoint.com/ruby-on-rails/index.htm http://www.tutorialspoint.com/ruby-on-rails-2.1/index.htm also search to get book "Agile Web Development with Rails " 3rd edition. it ll helpful for u.. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Air [EMAIL PROTECTED]
better go through this "http://fairleads.blogspot.com/";. it is more basic thinks -- 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 th

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Rohith Nair
And again... I have created another controller by taking CMD -> ruby script/generate controller test Then i edit the test_controller under app/controller class TestController < ApplicationController def index render_text "Test The Message" end end But once i test it with htt

[Rails] Re: Doing Subselect query in Rails... Syntax problem

2008-12-09 Thread Priya Dharsini
@books = Book.find(:all, :joins=>"books inner join authors as a on books.title=a.name", :conditions => ['name LIKE ? ', '%'+params[:author][:name]+'%']) try with the above code Jay Mark wrote: > I have to use subselect for this query. > find_all_by_name and joins will not work. > Please I nee

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Rohith Nair
My Database is under Linux machine -- 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@google

[Rails] Re: Doing Subselect query in Rails... Syntax problem

2008-12-09 Thread Priya Dharsini
Hi, Actually what's your requirement? If you tell your requirement clearly then the solution can be found. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Rohith Nair
Thanks friends... Now i used that database.yml that given. And then i have started the cmd -> ruby script/server Then re started my browser. Then got the starting page.. Click on the link and and got the details... This is the details Ruby version 1.8.6 (i386-mswin32) RubyGems version 1.3.1

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Air [EMAIL PROTECTED]
ok.. i never used windows for development. ubuntu or linux is good for development. -- 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

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread CFC
I know. I never use socket parameter when I developed on Windows :P On Wed, Dec 10, 2008 at 2:30 PM, Air *** <[EMAIL PROTECTED]>wrote: > > he was using window xp > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.bl

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Air ***
he was using window xp -- 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

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Air ***
use this Air *** wrote: > Air *** wrote: >> no need mysql in your system. >> >> you have to replace database.yml with my database.yml file. > > Delete your database.yml. then copy my "database.yml" i was attached > bfter that > then change follow thinks > > development: > adapter: mysql >

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread CFC
I think no need to change socket, just delete it :) On Wed, Dec 10, 2008 at 2:25 PM, Air *** <[EMAIL PROTECTED]>wrote: > > Air *** wrote: > > no need mysql in your system. > > > > you have to replace database.yml with my database.yml file. > > Delete your database.yml. then copy my "database.yml

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Air ***
Air *** wrote: > no need mysql in your system. > > you have to replace database.yml with my database.yml file. Delete your database.yml. then copy my "database.yml" i was attached after that then change follow thinks development: adapter: mysql database: test username: root password:

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Rohith Nair
Thanks Air... How can i do that?? How can i replace as my database.yml?? And billy... Wat u mean by generating model? i didn't do anything yet.. Just reached in the start up screen telling the message "Welcome abroad" -- Posted via http://www.ruby-forum.com/. --~--~-~--~~--

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Air ***
no need mysql in your system. you have to replace database.yml with my database.yml file. Attachments: http://www.ruby-forum.com/attachment/3048/database.yml -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you a

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread CFC
err .. Did you generated any model yet? And SQLite is not same as MySQL, they are different. Run cmd and type: gem i sqlite3-ruby And comment config.frameworks -= [ :active_record, :active_resource, :action_mailer ] And, restart your server and try again On Wed, Dec 10, 2008 at 2:01 PM, Rohith Nai

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Rohith Nair
Thank you for the reply Now i got message by clicking on the link ' About your application Environment' as "uninitialized constant ActiveRecord::Base" ok...And my databasse.yml is like this.. # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adap

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread CFC
If you will not use any database, you can cancel active_record. Modify config/environment.rb Uncomment this line: # config.frameworks -= [ :active_record, :active_resource, :action_mailer ] On Wed, Dec 10, 2008 at 1:51 PM, Rohith Nair < [EMAIL PROTECTED]> wrote: > > Thanks for ur reply... > > In

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Rohith Nair
Thanks for ur reply... In database.yml i can find this # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread Air ***
hi your rails app folder, go to config/database.yml in datebase.yml you will find like this development: adapter: mysql database: test username: root password: password host: localhost socket: /var/run/mysqld/mysqld.sock in host your that system ip like adapter: mysql data

[Rails] Re: wrong number of arguments (0 for 1) error.... Help!!!

2008-12-09 Thread Ryan Bigg
It's supported. It's the syntax I showed you before: Author.find_by_name("Blah").books, will get you all the books by that author. - Ryan Bigg Freelancer http://frozenplague.net On 10/12/2008, at 3:36 PM, Jay Mark wrote: > > Ryan Bigg wrote: >> I have no clue. Author.find_by_name sh

[Rails] Re: wrong number of arguments (0 for 1) error.... Help!!!

2008-12-09 Thread Jay Mark
Ryan Bigg wrote: > I have no clue. Author.find_by_name should be working when it > (apparently) is not. Something is broken. > - > Ryan Bigg > Freelancer > http://frozenplague.net I think so too. Thanks for your help. Why is it so hard to find the correct syntax for doing a subselect in Rail

[Rails] Re: Rails Hosting

2008-12-09 Thread Robby Russell
On Mon, Dec 8, 2008 at 10:20 PM, Abhishek shukla <[EMAIL PROTECTED]> wrote: > Hello Friends, > Can you please help in finding a good rails hosting site. who can give a > good technical support. > http://railsboxcar.com/ http://planetargon.com/hosting.html Cheers, Robby -- Robby Russell Chief

[Rails] Routing Error (javascript prob culprit)

2008-12-09 Thread David
I am using the DOM popup kit to create modal popups and am having trouble getting popups to work in IE6 when they are not in my main layout view. When they are not in the main layout view the popups always display beneath the overlay and cannot be accessed. But when I put them in my layout view,

[Rails] I am New to Ruby..Please Help me ON start

2008-12-09 Thread Rohith Nair
Hello All... I am new to ruby... I have installed ruby 1.8.6 in my XP machine. Installed by Ruby one-click installer. And then i have installed Apache2 Webserver. Then tried with a testProgram in Run-> cmd -> rails testProgram Then i have completed ruby script/server on cmd Then after that

[Rails] I am New to ruby..Please Help me

2008-12-09 Thread Rohith Nair
Hello All... I am new to ruby... I have installed ruby 1.8.6 in my XP machine. Installed by Ruby one-click installer. And then i have installed Apache2 Webserver. Then tried with a testProgram in Run-> cmd -> rails testProgram Then i have completed ruby script/server on cmd Then after that

[Rails] Re: RESTful routing: allowing .s [dots] in ids

2008-12-09 Thread Pete Hodgson
Lee Fyock wrote: > See . > > One solution is to add > module ActionController::Routing > SEPARATORS = %w( / ; , ? ) > end > in your controller. I'm not sure if this still works under recent > versions of Rails. > > Lee > > > On Dec 9, 3:42�pm, Pete Hod

[Rails] Re: RESTful routing: allowing .s [dots] in ids

2008-12-09 Thread Pete Hodgson
Philip Hallstrom wrote: > I haven't tried it with a restful route, but I have a route like this: > > r.curriculum '/curriculum/:code/:title/:action', > :defaults => { :action => 'overview' }, > :requirements => { :code => %r([\d.]+) } > > :code is a float

[Rails] Problem with Live Validation

2008-12-09 Thread Selva Raj
This looks very strange for me. I have added Live validation to my project, but later I removed that from project due to some reason. I roll back to old version too. Now if I look at my file there is no code related to Live Validation. But after rendering the rhtml if look at the view source ther

[Rails] Re: wrong number of arguments (0 for 1) error.... Help!!!

2008-12-09 Thread Ryan Bigg
I have no clue. Author.find_by_name should be working when it (apparently) is not. Something is broken. - Ryan Bigg Freelancer http://frozenplague.net On 10/12/2008, at 8:44 AM, Jay Mark wrote: > > Ryan Bigg wrote: >> And finally, what version of Rails? >> - >> Ryan Bigg >> Freel

[Rails] Re: find with add of an atttributes

2008-12-09 Thread Mark Reginald James
Luca Roma wrote: > I have wrote this: > EventDate.find(:all, > :include => [:container,{:event => > [:photo,:event_type_names]},{:place=>:location}], > :joins =>" RIGHT JOIN (SELECT > event_dates.id,date_add(event_dates.date, INTERVAL i DAY ) AS date > FROM (select 0

[Rails] Validation errrors: how to get rid of "Validation failed: " and the Objects in them

2008-12-09 Thread tyliong
Hi when ever i do rescue Exception => e flash[:error] = e.message the e.message will always contain the "Validation error:" string and the Object Example: Validation failed: Price "message:", Price "message" How do i tell rails that I just want the message? and

[Rails] Re: Rails noob confusion - HTML Form Post to Rails Controller?

2008-12-09 Thread Jferg
Hmmm I am not sure. What I want is to use the create (post) from outside of Rails from a page from another web app (not Rails). The front end does the sign on and other stuff and we are like an add-on. Does that make sense? Perhaps that is pure heresy and I should provide a web service and

[Rails] Re: ubiquity-rdoc, better rdoc searching

2008-12-09 Thread Cipriani
Hey Ryan, Thanks for the suggestion. I have aready implemented this type of search, please, update your command. http://projects.talleye.com/ubiquity-rdoc/ Regards Luis Cipriani On Dec 5, 4:11 am, Ryan Bigg <[EMAIL PROTECTED]> wrote: > You guys could hook it intohttp://rails.loglibrary.com/lo

[Rails] Re: subclassing vs mixins, which one should be used?

2008-12-09 Thread Philip Hallstrom
I don't know anything about your app, but if you don't use STI (ie. you leave abstract_class = true) you'll never be able to tell the difference b/n the two classes. That is... you could.. create a BlockSchedule with ID=1 create a DaySchedule with ID=2 BlockSchedule.all => returns both reco

[Rails] Re: Optional route parameters for resource routes?

2008-12-09 Thread Andrew Bloom
map.resources :images, :member => [:500, :1000] will map to 2 methods in your controller, but I think you might have problems giving ruby method names that start with numbers. you probably just have to make a specially entry in your routes file, something like this: map.cached_image '/images/:i

[Rails] Re: Opinion on Multiple forms on same page

2008-12-09 Thread Hassan Schroeder
On Tue, Dec 9, 2008 at 5:18 PM, s.ross <[EMAIL PROTECTED]> wrote: > > Well, POST data is actually delivered as-if a hidden query string. So, > for a GET request, you have an HTTP QUERY_STRING and for a POST > request you have a RAW_POST_DATA. Both are functionally equivalent Mmm. Well, they both

[Rails] Re: mac vs windows - why is windows soooo slow?

2008-12-09 Thread CFC
Cause Bill and Ballmer are fatter then Jobs :P On Wed, Dec 10, 2008 at 4:10 AM, Jurket Largit < [EMAIL PROTECTED]> wrote: > > > With the release of rails 2.2.2, the speed hit was huge. On my PC, > running rails 2.0.2, it took about 10 seconds to run one of the unit > tests (most of the time loadi

[Rails] Re: Opinion on Multiple forms on same page

2008-12-09 Thread s.ross
Well, POST data is actually delivered as-if a hidden query string. So, for a GET request, you have an HTTP QUERY_STRING and for a POST request you have a RAW_POST_DATA. Both are functionally equivalent and neither are scoped. Look, it can and does work, and there's no reason to believe it w

[Rails] Re: inserting many records into a database

2008-12-09 Thread Farmer Schlutzenberg
Thanks a lot! That looks really useful. -- 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@go

[Rails] Re: Opinion on Multiple forms on same page

2008-12-09 Thread Hassan Schroeder
On Tue, Dec 9, 2008 at 4:24 PM, s.ross <[EMAIL PROTECTED]> wrote: > > POST data is not structured, so while you can use multiple forms on > the same page, there could also be namespace conflicts. The resulting > query string (in case of a conflict) could be really bizarre and prone > to subtle bug

[Rails] Re: Opinion on Multiple forms on same page

2008-12-09 Thread s.ross
POST data is not structured, so while you can use multiple forms on the same page, there could also be namespace conflicts. The resulting query string (in case of a conflict) could be really bizarre and prone to subtle bugs. Not a problem when it's you writing the code or when the page is

[Rails] Re: subclassing vs mixins, which one should be used?

2008-12-09 Thread Frederick Cheung
On 10 Dec 2008, at 00:13, BushyMark wrote: > > Fred, thanks for the info! > > I like the idea of creating a super class, if only for the naming > convention I have setup. I just wanted to check my syntax though. > > The two models are called BlockSchedule and DaySchedule. > > Lets say I wanted t

[Rails] Re: subclassing vs mixins, which one should be used?

2008-12-09 Thread BushyMark
Fred, thanks for the info! I like the idea of creating a super class, if only for the naming convention I have setup. I just wanted to check my syntax though. The two models are called BlockSchedule and DaySchedule. Lets say I wanted them both to inherit the properties of a class called Schedul

[Rails] Re: RESTful routing: allowing .s [dots] in ids

2008-12-09 Thread Philip Hallstrom
I haven't tried it with a restful route, but I have a route like this: r.curriculum '/curriculum/:code/:title/:action', :defaults => { :action => 'overview' }, :requirements => { :code => %r([\d.]+) } :code is a float-like number. 11.123, etc. The above

[Rails] Re: subclassing vs mixins, which one should be used?

2008-12-09 Thread Frederick Cheung
On Dec 9, 11:58 pm, BushyMark <[EMAIL PROTECTED]> wrote: > Hey all, > > I have two models in my rails project that share a lot of traits. They > each have the same 4 properties, and now I need to add 2-3 methods to > each one that will be the same. In the spirit of DRY I am looking for > a solut

[Rails] subclassing vs mixins, which one should be used?

2008-12-09 Thread BushyMark
Hey all, I have two models in my rails project that share a lot of traits. They each have the same 4 properties, and now I need to add 2-3 methods to each one that will be the same. In the spirit of DRY I am looking for a solution to write these methods only once. Both of these models already in

[Rails] Re: Testing w/ Xapian and other off-line indexing search engines

2008-12-09 Thread Frederick Cheung
On 9 Dec 2008, at 23:37, Jeffrey L. Taylor wrote: > > Quoting Frederick Cheung <[EMAIL PROTECTED]>: >> On 9 Dec 2008, at 21:33, Jeffrey L. Taylor wrote: > [snip] >>> I think I've found the answer. The key thing is that the test >>> script is >>> adding a record at run time. ActiveRecord does n

[Rails] Re: Testing w/ Xapian and other off-line indexing search engines

2008-12-09 Thread Jeffrey L. Taylor
Quoting Frederick Cheung <[EMAIL PROTECTED]>: > On 9 Dec 2008, at 21:33, Jeffrey L. Taylor wrote: [snip] > > I think I've found the answer. The key thing is that the test > > script is > > adding a record at run time. ActiveRecord does not commit these > > records. > > This is so it can roll

[Rails] Re: HABTM checkboxes insert but don't delete

2008-12-09 Thread tecregio
hehe silly me, i should have shown you the entire code, i had a service= definition that was conflicting with the deletion =p On 9 dic, 12:25, tecregio <[EMAIL PROTECTED]> wrote: > yes, i think i'm following exactly the tutorial, however it doesn't > work... > > here's the code: > > #profile mode

[Rails] Re: RESTful routing: allowing .s [dots] in ids

2008-12-09 Thread Lee Fyock
See . One solution is to add module ActionController::Routing SEPARATORS = %w( / ; , ? ) end in your controller. I'm not sure if this still works under recent versions of Rails. Lee On Dec 9, 3:42 pm, Pete Hodgson <[EMAIL PROTECTED]> wrote: > Hi Folks,

[Rails] Rails 2.2.2 session is failing in pstore using file_field_tag

2008-12-09 Thread Deeg
When I try to upload a file using the file_field_tag I get the following exception (top 10 lines in the stack shown): /!\ FAILSAFE /!\ Tue Dec 09 17:11:12 -0500 2008 Status: 500 Internal Server Error End of file reached /usr/local/lib/jruby-1.1.5/lib/ruby/1.8/pstore.rb:355:in `load'

[Rails] Combining Purchases

2008-12-09 Thread Ernie
I am able to combine purchase, however the quantity is not showing, any suggestions? Code: class Basket attr_reader :purchases attr_reader :total def initialize @purchases = [] @total = 0.0 end def add_purchase(cart) @purchases << Purch

[Rails] Re: Rails 2.2 Integration tests cookie store

2008-12-09 Thread Lee Fyock
What I ended up doing was overriding the default options in RackRequest. In test.rb, I added class ActionController::RackRequest DEFAULT_SESSION_OPTIONS = { :database_manager => CGI::Session::MemoryStore, # store data in memory :prefix => "ruby_sess.",# prefix session fil

[Rails] Re: wrong number of arguments (0 for 1) error.... Help!!!

2008-12-09 Thread Jay Mark
Ryan Bigg wrote: > And finally, what version of Rails? > - > Ryan Bigg > Freelancer > http://frozenplague.net I am using 2.0.2 with mysql database Cypray -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you ar

[Rails] Re: getting a real int from DB

2008-12-09 Thread Frederick Cheung
On 9 Dec 2008, at 22:30, Mickael Faivre-Macon wrote: > > Hi, > > I have a User class with many projects : > > has_many :projects, :through=>:membership, :select => > "memberships.active, projects.*" > > The active field in the memberships table is an int. > > So why this works : > > def active

[Rails] Re: Rails Hosting

2008-12-09 Thread Abhishek shukla
Anyone have a hosted RoR application on http://www.lunarpages.com/ or http://www.hostmysite.com/ Regards Abhi On Tue, Dec 9, 2008 at 6:50 PM, James Englert <[EMAIL PROTECTED]>wrote: > I've had good luck with hostingrails.com > > > On Tue, Dec 9, 2008 at 1:20 AM, Abhishek shukla <[EMAIL PROTECTED

[Rails] Re: Doing Subselect query in Rails... Syntax problem

2008-12-09 Thread Jay Mark
Jeff Cohen wrote: > On Dec 9, 1:47�pm, Jay Mark <[EMAIL PROTECTED]> wrote: >> Jeff Cohen wrote: >> Thanks for all your help Jeff. >> It is still not working. >> The find_by_name, gives me this error: >> "undefined method `find_by_name' for " > > Can you post the full details of the error mess

[Rails] Re: RESTful design advice

2008-12-09 Thread Andy Koch
I've always used HM :through for descriptive associations - usually I just want a created_at date so one could determine when a user joined a group (for example). I don't see how a "Tracker", which looks like a join, makes sense without both a User and a Player. This is correct understanding: "r

[Rails] getting a real int from DB

2008-12-09 Thread Mickael Faivre-Macon
Hi, I have a User class with many projects : has_many :projects, :through=>:membership, :select => "memberships.active, projects.*" The active field in the memberships table is an int. So why this works : def active_projects projects.select{|p| p.active=='1'}.sort_by {|p| [p.name.upca

[Rails] Re: newbie stumped - when form validates, normally return is fine, but when I select a certain check

2008-12-09 Thread Rick
On Tue, Dec 9, 2008 at 4:24 PM, Frederick Cheung <[EMAIL PROTECTED]> wrote: > On Dec 9, 9:00 pm, Rick <[EMAIL PROTECTED]> wrote: >> On Tue, Dec 9, 2008 at 3:22 PM, Shandy Nantz >> >> >> Can someone give me some tips as to what even might be wrong or where >> I should start to look? I have some lo

[Rails] Re: Testing w/ Xapian and other off-line indexing search engines

2008-12-09 Thread Frederick Cheung
On 9 Dec 2008, at 21:33, Jeffrey L. Taylor wrote: > > Quoting Jeffrey L. Taylor <[EMAIL PROTECTED]>: >> >> I am running into problems testing with Xapian and Sphinx, both off- >> line index >> updating search engines (i.e., adding/changing an indexed record >> puts the re >> uest into a queue

[Rails] Re: RESTful design advice

2008-12-09 Thread lunaclaire
Thanks, Andy. It occurred to me this morning that it would useful to add the has_many/through to it. I'm still not clear though on the nested aspect of the design. I ~thought~ I needed to nest the *Trackers* under one or the other of Users or Players... this follows from my reading that resource

[Rails] Re: wrong number of arguments (0 for 1) error.... Help!!!

2008-12-09 Thread Ryan Bigg
And finally, what version of Rails? - Ryan Bigg Freelancer http://frozenplague.net On 09/12/2008, at 11:11 PM, Jay Mark wrote: > > Here is the result from ruby script/console >>> Author.new > => # > >>> Book.new > => # > > > > > > Ryan Bigg wrote: >> Ok... then you're on your own if yo

[Rails] Re: Creating instance of ActionMailer for testing

2008-12-09 Thread Dmitry Ratnikov
Thanks for the reply! Your solution works, but it is pretty much same as just doing assert_matches. After some thinking I realized that I can just stub out the render_message of the ActionMailer::Base class: context "Email body hash" do setup do @bar = Bar.create! FooMailer.any_in

[Rails] Re: Testing w/ Xapian and other off-line indexing search engines

2008-12-09 Thread Jeffrey L. Taylor
Quoting Jeffrey L. Taylor <[EMAIL PROTECTED]>: > > I am running into problems testing with Xapian and Sphinx, both off-line index > updating search engines (i.e., adding/changing an indexed record puts the re > uest into a queue with the actual work done in a cronjob). To test I can load > the f

[Rails] How to write functional tests for a nested route?

2008-12-09 Thread Patrick Doyle
Starting from here: $ rails classic $ cd classic $ script/generate scaffold post title:string body:text $ rake db:migrate $ rake test (tests pass, as expected) $ script/generate scaffold comment post:belongs_to body_text $ rake db:migrate $ rake test (tests pass again, as expected) Edit config/ro

[Rails] Re: newbie stumped - when form validates, normally return is fine, but when I select a certain check

2008-12-09 Thread Frederick Cheung
On Dec 9, 9:00 pm, Rick <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 3:22 PM, Shandy Nantz > > > Can someone give me some tips as to what even might be wrong or where > I should start to look? I have some log statements and the same flow > seems to happen regardless of the scenario. > Is

[Rails] Optional route parameters for resource routes?

2008-12-09 Thread Ben Johnson
I have the following URL: /images/1.jpg?size=500 Where images is a resource setup via map.resources :images. I want to take advantage of caching, and caching ignores parameters. So I need to make size optional in the url: /images/1/500.jpg Something like that where the size can be built into t

[Rails] Re: Doing Subselect query in Rails... Syntax problem

2008-12-09 Thread Jeff
On Dec 9, 1:47 pm, Jay Mark <[EMAIL PROTECTED]> wrote: > Jeff Cohen wrote: > Thanks for all your help Jeff. > It is still not working. > The find_by_name, gives me this error: > "undefined method `find_by_name' for " Can you post the full details of the error message from your log file? Also

[Rails] Re: newbie stumped - when form validates, normally return is fine, but when I select a certain check

2008-12-09 Thread Rick
y (see figure 2.) The part that has me so stumped is that when you happen to check the "home" checkbox and you submit, I end up with an extra object created when validation fails! (see figure 3, you'll see the extra player game object column.) I have no idea why, and I have no

[Rails] RESTful routing: allowing .s [dots] in ids

2008-12-09 Thread Pete Hodgson
Hi Folks, I'm trying to set up a RESTful route in my rails app and have hit a snag. My application allows various different types of querying centered around a search phrase, and I decided it'd be nice to that in my RESTful API by exposing resources like: http://www.myapp.com/api/keyword_researc

[Rails] Re: Active record :find having an if statement inside the conditions

2008-12-09 Thread Tan YL
Thanks I'll try it out when I have the time -Original Message- From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ar Chron Sent: Wednesday, December 10, 2008 4:33 AM To: rubyonrails-talk@googlegroups.com Subject: [Rails] Re: Active record :find having an if st

[Rails] Re: Active record :find having an if statement inside the conditions

2008-12-09 Thread Ar Chron
Tyl Tan wrote: > If x equal 200 then I want the find to check that y is equal to 300 but > if x is not equal to 200 there should be no check with y Well, :conditions => ["x <> ? or (x = ? and y = ?)", 200, 200, 300] If SQL short-circuits the logic, that shouldn't check y when x != 200 -- Post

[Rails] Re: VMWare, Webrick nooby question

2008-12-09 Thread Ar Chron
I assume that with a bridged or host-only setup, you would browse to your virtual machine name, not localhost. If I use a Host-only network... In the VM, run ifconfig (I use Ubuntu), that reports 192.168.64.128 as the IP address of the virtual machine. In Windows, browse to http://192.168.64.

[Rails] Re: newbie stumped - when form validates, normally return is fine, but when I select a certain check

2008-12-09 Thread Shandy Nantz
What is your log saying? -- 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

[Rails] Re: Active record :find having an if statement inside the conditions

2008-12-09 Thread Tan YL
If x equal 200 then I want the find to check that y is equal to 300 but if x is not equal to 200 there should be no check with y -Original Message- From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ar Chron Sent: Wednesday, December 10, 2008 4:14 AM To: ruby

[Rails] Re: Creating instance of ActionMailer for testing

2008-12-09 Thread Craig Demyanovich
Email templates change very rarely on my project, so I don't mind the usual approach of matching the body against a few patterns. And, it's easy to do. Anyway, here's an example spec of a mailer on my current project: describe Mailer, "job application submitted" do before(:each) do @user =

[Rails] Cleaning session variables when going to another link of the website

2008-12-09 Thread The Neurochild
Hi there! I wish to set my session variables to null when click on a link of my Rails website. My major problem is this: when I click on a link and then return to the previous view, my session variables still remain, unless I click on a cleaning button where I set my variables to null (nil) (via

[Rails] Re: How to upgrade an existing application to 2.2.2?

2008-12-09 Thread Patrick Doyle
On Tue, Dec 9, 2008 at 10:38 AM, Codeblogger <[EMAIL PROTECTED]> wrote: > Hi Patrick, > > what do your tests/specs tell you? Do they pass? > > I forgot to mention that all of the tests pass before and after running the $ rake rails:update The main reason that I forgot to mention that was that, u

[Rails] Re: Active record :find having an if statement inside the conditions

2008-12-09 Thread Ar Chron
Or is it just: :conditions => ["(x = ? and y = ?)", 200, 300] i.e., do you want the items where x != 200 or not? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on R

[Rails] Re: Active record :find having an if statement inside the conditions

2008-12-09 Thread Ar Chron
Tyl Tan wrote: > Hi, i was just wondering if its is possible to put a if statment > inside the find conditions > > > for example: > > grovery_price = model.find(:first, :conditions => [ "if x = ? then y > must = ?", 200, 300] > > I have been googling for some time for a solution to this but i

[Rails] Re: mac vs windows - why is windows soooo slow?

2008-12-09 Thread Jurket Largit
With the release of rails 2.2.2, the speed hit was huge. On my PC, running rails 2.0.2, it took about 10 seconds to run one of the unit tests (most of the time loading the environment). On 2.2.2, it is now taking about 30 seconds, a 3x slowdown. I'm guessing it's because rails is now much fat

[Rails] Active record :find having an if statement inside the conditions

2008-12-09 Thread tyliong
Hi, i was just wondering if its is possible to put a if statment inside the find conditions for example: grovery_price = model.find(:first, :conditions => [ "if x = ? then y must = ?", 200, 300] I have been googling for some time for a solution to this but i just can't seem to find any. --~--~

[Rails] Re: Getting from geolocation (lat/long) to Time.zone

2008-12-09 Thread tomkarlo
I'm already using the geonames API... unless there's a service out there that returns names matching those in Time.zone it seems like this would leave me with exactly the same problem. On Dec 9, 1:06 pm, Danny Burkes <[EMAIL PROTECTED]> wrote: > > You need a lat/long to timezone database- many ar

[Rails] newbie stumped - when form validates, normally return is fine, but when I select a certain checkbox, I end up with a new object created on return

2008-12-09 Thread Rick
m field cause the problem and not the other form fields??? figure 1: http://img.skitch.com/20081209-kcbuias6u29g4ce8a3wuyu6xcf.jpg figure 2: http://img.skitch.com/20081209-1ceh84wc8dnisfjuiimw7fk9qe.jpg figure 3: http://img.skitch.com/20081209-gwk2ib89c2kfm1hhs3ymh7fc4e.jpg Can someone give

[Rails] Re: Problem extending ActiveRecord with custom validations

2008-12-09 Thread gaveeno
Thanks Fred, interesting blog post! On Dec 9, 11:40 am, Frederick Cheung <[EMAIL PROTECTED]> wrote: > On Dec 9, 7:17 pm, gaveeno <[EMAIL PROTECTED]> wrote: > > > Thanks Fred, that worked!  I created config/initializers/ > > custom_validations.rb and moved the require line there from the > > envir

[Rails] Re: Doing Subselect query in Rails... Syntax problem

2008-12-09 Thread Jay Mark
Jeff Cohen wrote: > On Dec 9, 11:52�am, Jay Mark <[EMAIL PROTECTED]> wrote: > >> where title is equal to the title returned by the inner query. >> The strange thing here is, title has a unique entry in authors table, >> but title has duplicate entries in the book table. >> >> So, the main point h

[Rails] VMWare, Webrick nooby question

2008-12-09 Thread ChasManRors
RoR vmware question (I have cross posted): Trying to web-browse my Webrick server running Llinux on vmware Guest from Windows host. Clearly I can't do an http://localhost:3000/. So how can I access my Linux Webrick server guest from Windows? --~--~-~--~~~---~--~~

[Rails] Creating instance of ActionMailer for testing

2008-12-09 Thread Dmitry Ratnikov
Hi all, I am writing an action mailer test and am trying to snatch contents of the @body hash provided for the template for testing. Specifically, my plan is to do something like: FooMailer.class_eval do attr_accessor :original_body def render_message method, body self.original_body =

[Rails] Re: Problem extending ActiveRecord with custom validations

2008-12-09 Thread Frederick Cheung
On Dec 9, 7:17 pm, gaveeno <[EMAIL PROTECTED]> wrote: > Thanks Fred, that worked!  I created config/initializers/ > custom_validations.rb and moved the require line there from the > environment.rb file.  It's not clear to me why this works, and it Short version: because it means the require wil

[Rails] Re: Problem extending ActiveRecord with custom validations

2008-12-09 Thread gaveeno
Thanks Fred, that worked! I created config/initializers/ custom_validations.rb and moved the require line there from the environment.rb file. It's not clear to me why this works, and it seems like it's overkill to create a new file for this, but as long as it works it's cool with me. Thanks aga

[Rails] Re: Problem extending ActiveRecord with custom validations

2008-12-09 Thread Frederick Cheung
On 9 Dec 2008, at 19:05, gaveeno wrote: > > I'm having a problem extending ActiveRecord with custom validations > based on the "Write Custom Validations" recipe from Advanced Rails > Recipes. As far as I can tell, I've followed the instructions exactly > but for some reason this isn't working a

[Rails] Problem extending ActiveRecord with custom validations

2008-12-09 Thread gaveeno
I'm having a problem extending ActiveRecord with custom validations based on the "Write Custom Validations" recipe from Advanced Rails Recipes. As far as I can tell, I've followed the instructions exactly but for some reason this isn't working and it's driving me crazy. I've tried making the meth

[Rails] Re: Doing Subselect query in Rails... Syntax problem

2008-12-09 Thread Jeff
On Dec 9, 11:52 am, Jay Mark <[EMAIL PROTECTED]> wrote: > Here is the table structure: > > Author has id, name, title, book_id  and other columns > Book has id, title, isbn, and other columns. > > They both have the title column. And, yes, authors has book_id as a > foreign key > for books. > The

[Rails] Re: How to upgrade an existing application to 2.2.2?

2008-12-09 Thread Craig Demyanovich
$ rake -T rails shows an update task but not an upgrade one (in my 2.1.1 app). The rails:update task only updates "configs, scripts and public/javascripts from Rails." It doesn't update Rails itself. If you have Rails in vendor/rails, then you'll have to replace that w/ 2.2.2. If you're depending

  1   2   >