[Rails] Using searchlogic with acts_as_taggable_on

2010-06-23 Thread my
Hi, i have 2 model, Merchant and Items and using acts_as_taggable_on Merchant has_many Items, and i try to find Merchant with search logic including the tags class Merchant < ActiveRecord::Base acts_as_taggable has_many :items end class Item < ActiveRecord::Base acts_as_taggable belong

[Rails] weird ArgumentError in non-ActiveRecord models

2010-06-23 Thread candor
Hi, I have a rails (2.3.5) project that has two models that are not ActiveRecord based - one is called Wiki and another is called WebApi. I have been using this in the past, and it was working. However, something I did is now causing ArgumentError to be raised when I call a class method on WebApi

[Rails] searchlogic+date_select+ordering

2010-06-23 Thread Chris S.
hi there, i try to use searchlogic to find entities by date. its working if i just try to search something. the ordering helper is also working if i just show all results. if i want to order (lets say by zipcode) and find by date it wont work. the order helper messes up the params[:search] in case

Re: [Rails] Rails 2.3.2 upgrade to 2.3.8 problem

2010-06-23 Thread Jeffrey L. Taylor
Quoting Bharat Ruparel : > Upgrading to Rails 2.3.8 from 2.3.2 has broken views in my application. [snip] Rails 2.3.8 is a stepping stone to Rails 3 with lots of deprecation warnings and some actual changes. And not all Gems and plugins are compatible with it. I suggest migrating from 2.3.2 to

[Rails] Rails 2.3.2 upgrade to 2.3.8 problem

2010-06-23 Thread Bharat Ruparel
Upgrading to Rails 2.3.8 from 2.3.2 has broken views in my application. Specifically the field labels are all displaying after the label text and therefore the alignment is all messed up. Instead of nicely aligning with the label text on the top and text entry field under it, they line up side-b

[Rails] Newbie on rails, need some help :D

2010-06-23 Thread Newbie Onrails
Hello, thanks for reading. I used scaffolding to set my pages up, and I've been editing them to get the effect that I want, but I'm running into a few problems. The first problem: I have 2 drop down menus, with pre-determined choices, let's say, "Ruby, Python, Java" are in the first drop down, a

Re: [Rails] ActionMailer + GMail STMP: How to set FROM header?

2010-06-23 Thread Jon Brisbin
On Jun 23, 2010, at 4:16 PM, Tom Pett wrote: > I am using Ruby 1.8.7 with Rails 2.3.8 and the GMail SMTP configuration. > > However all mail being sent by my application has its 'from' field as > the gmail address that logs in, instead of what I supply in the from > function of my ActionMailer.

[Rails] Re: problem with database still sqlite3 and i want mysql

2010-06-23 Thread gezope
Thanks a lot, unfortunately my problem hasn't solved. But I found that everything works well, just it was scary for a beginner. And still strange a bit, but I will not spend more time with it, because all other things are ok, so I did not find it too important - now I have to change the DB on the s

Re: [Rails] Negation for searches

2010-06-23 Thread dieinzige
use sphinx with gem as thinking_sphinx is super fast full text search engine Best Regards, Dieinzige On 23 Jun, 2010,at 09:39 PM, Thitsa Myaing wrote: What is an efficient way to search for records that does not contain a specific keyword. e.g Find people where the state is not "MA" and fi

[Rails] Negation for searches

2010-06-23 Thread Thitsa Myaing
What is an efficient way to search for records that does not contain a specific keyword. e.g. Find people where the state is not "MA" and first name contains "John". This should find: John Doe in NY Johnston Ried in CA But not: John Swann in MA I have been using my own search routines for th

Re: [Rails] Re: I need to do some code that should be in a controller inside a render partial. How??

2010-06-23 Thread dieinzige
as notes* at ruby, u va access to all methods of class, wherever u have any instance of this class =)  =) Best Regards, Dieinzige On 23 Jun, 2010,at 09:33 PM, Michael Pavling wrote: On 23 June 2010 22:18, Bob Smith wrote: Thanks. That should work fine.. Is there anything special to do to

Re: [Rails] Re: I need to do some code that should be in a controller inside a render partial. How??

2010-06-23 Thread Michael Pavling
On 23 June 2010 22:18, Bob Smith wrote: > Thanks. That should work fine.. Is there anything special to do to > make the method seen in the view? As long as it's a public method, it will be accessible wherever you have any instance of the class. -- You received this message because you are subsc

[Rails] Release of th new 1.1 version of VirtualRails

2010-06-23 Thread Jerome Fillioux
the new virtualrails 1.1 now includes : - git - mongodb - capistrano - ack - vim - improved US keyboard support Please check it at http://www.virtualrails.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Re: VirtualRails : The FREE Ruby on Rails virtual development platform

2010-06-23 Thread Jerome Fillioux
the new virtualrails 1.1 now includes git, mongodb, capistrano, ack, vim, and an improved US keyboard support :) check it at http://www.virtualrails.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

[Rails] Re: I need to do some code that should be in a controller inside a render partial. How??

2010-06-23 Thread Bob Smith
Thanks. That should work fine.. Is there anything special to do to make the method seen in the view? Bob On Jun 22, 6:17 am, Michael Pavling wrote: > On 22 June 2010 07:42, Bob Smith wrote: > > > The app has a print method in the controller. It does a render partial > > to loop through each cu

[Rails] ActionMailer + GMail STMP: How to set FROM header?

2010-06-23 Thread Tom Pett
I am using Ruby 1.8.7 with Rails 2.3.8 and the GMail SMTP configuration. However all mail being sent by my application has its 'from' field as the gmail address that logs in, instead of what I supply in the from function of my ActionMailer. Is there any way to change this, or this is a restrictio

Re: [Rails] How to see the feed of your items

2010-06-23 Thread dieinzige
yep this first mistake rails generate only api(xml, json) and html scaffold, rss its subs of xml, but not the same, u should u own write rss.xmlbuilder with rss schema definition, or use some plugins, such as atom feed, and so on the first mistake, if u wanna that u browser show u the "rss" link

Re: [Rails] How to see the feed of your items

2010-06-23 Thread Michael Pavling
On 23 June 2010 21:43, rodrigo3n wrote: > Hello everyone, I am a bit confused with the XML markup the controller > generates in an rails scaffold, because I can't see it. For example, I > create a post scaffold then I go to http://localhost:3000/posts but I > can't see the RSS icon on the nav bar

[Rails] How to see the feed of your items

2010-06-23 Thread rodrigo3n
Hello everyone, I am a bit confused with the XML markup the controller generates in an rails scaffold, because I can't see it. For example, I create a post scaffold then I go to http://localhost:3000/posts but I can't see the RSS icon on the nav bar on Firefox, neither in Chrome with an extension.

[Rails] Re: Deploy: Developing on Windows Deploying on Linux hosting

2010-06-23 Thread Ali Imran
I found this and use this method to install ruby on rails on virtual box http://panthersoftware.com/articles/view/6/ruby-on-rails-development-on-ubuntu-9-04-jaunty-using-ruby-1-8-6 On Jun 23, 8:28 am, Ali Imran wrote: > I installed It , Can you please help me how to setup the Ruby on rails > o

[Rails] Re: PHP to RoR: What is equal of insert in RoR

2010-06-23 Thread Ali Imran
Thanks buddy. On Jun 23, 12:16 pm, Amala Singh wrote: > Ali, > > Before you are trying out in the view, use the console and try out that > what you want to with the models. > using > ruby script/console in the project directory. > > Then go step by step with the views. > > Go through the tutorial

Re: [Rails] Re: PHP to RoR: What is equal of insert in RoR

2010-06-23 Thread Amala Singh
Ali, Before you are trying out in the view, use the console and try out that what you want to with the models. using ruby script/console in the project directory. Then go step by step with the views. Go through the tutorials first. We can not teach you basics here. On 23 June 2010 18:59, Ali I

[Rails] Re: PHP to RoR: What is equal of insert in RoR

2010-06-23 Thread Ali Imran
There is no relationship between models. but i only have one controller and trying to control two models with it it is possible.. On Jun 23, 11:56 am, Fernando Brito wrote: > Hm, why are you using <% %>? Is this code in your viewer? > Do you have a column "catid" for your model Category? > > Co

Re: [Rails] Re: PHP to RoR: What is equal of insert in RoR

2010-06-23 Thread Fernando Brito
Hm, why are you using <% %>? Is this code in your viewer? Do you have a column "catid" for your model Category? Could you please describe better what your models look like and what kind of relationship do they have between them? Thanks, Fernando Brito -- You received this message because you ar

[Rails] Controller and Scaffold Controller generator - plural vs. singular

2010-06-23 Thread Fernando Brito
Hello, Why does: *$ rails g controller project* Generates *app/controllers/project_controller.rb* and *$ rails g scaffold_controller project* Generates *app/controllers/projects_controller.rb* and *app/views/projects/* ? With scaffold_controller there is even the following message at the end:

[Rails] Re: PHP to RoR: What is equal of insert in RoR

2010-06-23 Thread Ali Imran
Thanks... I try this and its work ... <% @obj= params[:category] @cat...@obj["catid"] @newrec= Category.new(:catid=>@catid) @newrec.save %> but when i try to do this like this.. its not working ... reason it is different because ... I have only controller for "Category" and i have model fo

Re: [Rails] PHP to RoR: What is equal of insert in RoR

2010-06-23 Thread Amala Singh
Philip has given good links. Basically all the database related stuffs are handled by the Active Record class which is one of the components of MVC(Model View Controller) architecture. Rails handles the create record stuff the same way traditional programming languages such as C++ via new constru

Re: [Rails] PHP to RoR: What is equal of insert in RoR

2010-06-23 Thread Philip Hallstrom
On Jun 23, 2010, at 10:13 AM, Ali Imran wrote: > In PHP from form > > we get values in POST OR GET > > > than I use mysql_query(insert_value) > > what is its equal in ROR > http://guides.rails.info/getting_started.html http://guides.rails.info/active_record_querying.html -philip > -- >

Re: [Rails] attribute name selected in form

2010-06-23 Thread Lasse Bunk
Or you could make the [] method you mentioned. In your model: def []=(lang, term) self.attributes = { lang => term } end Then you can call it like you wanted: @thesaurus['fr'] = "Bonjour" /Lasse 2010/6/23 Lasse Bunk > Hi, > > I suppose the best way to do this would be to create a row for e

[Rails] PHP to RoR: What is equal of insert in RoR

2010-06-23 Thread Ali Imran
In PHP from form we get values in POST OR GET than I use mysql_query(insert_value) what is its equal in ROR -- 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 uns

Re: [Rails] attribute name selected in form

2010-06-23 Thread Lasse Bunk
Hi, I suppose the best way to do this would be to create a row for each word having a column for lang and a column for term. If you want to do it the way you describe, you could do it like this: With validation: @thesaurus.update_attributes params[:lang] => term Without validation: @thesaurus.u

[Rails] Re: Redirecting old URLs to new permalinked URLs

2010-06-23 Thread Joe
I see code like this used in examples: config.gem 'rack-rewrite', '~> 1.0.0' require 'rack/rewrite' config.middleware.insert_before(Rack::Lock, Rack::Rewrite) do rewrite '/wiki/John_Trupiano', '/john' r301 '/wiki/Yair_Flicker', '/yair' r302 '/wiki/Greg_Jastrab', '/greg' r301 %r

[Rails] Re: Redirecting old URLs to new permalinked URLs

2010-06-23 Thread Joe
I see code like this used in examples: config.gem 'rack-rewrite', '~> 1.0.0' require 'rack/rewrite' config.middleware.insert_before(Rack::Lock, Rack::Rewrite) do rewrite '/wiki/John_Trupiano', '/john' r301 '/wiki/Yair_Flicker', '/yair' r302 '/wiki/Greg_Jastrab', '/greg' r301 %r

Re: [Rails] Re: [ANN] ice_cube 0.3.1

2010-06-23 Thread Michael Pavling
On 23 June 2010 16:53, John Crepezzi wrote: > Can you give some more details? > ice_cube's times are expressed as Time(s) in Ruby. I'm finding that - although it's not clear from the readme (which just shows "end_date"). The methods accept Dates as parameters, and seem to populate okay.. things j

[Rails] Re: [ANN] ice_cube 0.3.1

2010-06-23 Thread John Crepezzi
Can you give some more details? ice_cube's times are expressed as Time(s) in Ruby. Maybe just some sample code? On Jun 23, 11:06 am, Michael Pavling wrote: > I'm just having a look at this, as I've another need for > recurrence-tracking. Previously I've used RiCal, but liked the look of > IceCub

[Rails] render :kml

2010-06-23 Thread chewmanfoo
kml is an xml format used by Google Maps for specifying a map and markers and other things in the GMap. I have a model Carrier which has_many :addresses. Each Address has the standard fields (address1, address2, city, state, zip) as well as geocode latitude and longitude strings. Is it trivial t

[Rails] Re: Use reflection to show the list

2010-06-23 Thread Bohdan Pohoriletz
Duno if it helps but #view <%= render :partial= "partials/values", :collection => @values%> #action @values = Object.all #_value.html.erb <% value.attributes.each do |a| %> <%= a.to_a[0] %>: <%= a.to_a[1]> <% end %> ["crypted_password", nil] ["username", nil] ["password_salt", nil] ["persis

[Rails] Re: Pass instance variable from one method to another controller

2010-06-23 Thread Rails Learner
Hi Marnen, Thanks for confirming that. Many Thanks! -- 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 th

[Rails] Re: could not find rmagick locally or in a repository

2010-06-23 Thread Carlo Bertini
Vishwa Rao wrote: > Sharagoz -- wrote: >> You really should try to do some research on your own before asking >> questions in forums. Most questions have already been asked and >> answered. Simply googling for "msvcrt-ruby18.dll" results in the answer >> at the 2nd hit. >> >> Quote, Tim Hunter,

Re: [Rails] Re: [ANN] ice_cube 0.3.1

2010-06-23 Thread Michael Pavling
I'm just having a look at this, as I've another need for recurrence-tracking. Previously I've used RiCal, but liked the look of IceCube as a little more lightweight. But I'm getting lots of error in my console with Dates being compared to Times, or missing "utc_offset" method have I missed some

Re: [Rails] CSV Upload Issue

2010-06-23 Thread Rob Biedenharn
On Jun 23, 2010, at 8:56 AM, Pale Horse wrote: CSV: http://pastie.org/1015772 Controller: http://pastie.org/1015773 Why is it that it's only saving the record for "EFG5"? I'm obviously missing something. The call to .save the model is outside of the loop. You should indicate which version

[Rails] Re: Deploy: Developing on Windows Deploying on Linux hosting

2010-06-23 Thread Ali Imran
I installed It , Can you please help me how to setup the Ruby on rails over this virtual machine.? Thanks.. On Jun 22, 6:46 am, Ar Chron wrote: > Ali Imran wrote: > > I am trying from a week to deploy my application. Please help me how > > to do this. > > > Thanks > > To save yourself tons of p

[Rails] Re: Mysql::Error (Can't connect to MySQL server on )

2010-06-23 Thread regnever
I had mysql connection error on a production machine. The problem wascaused by incorrect location or missing mysql.sock file. Maybe you have the same issue. On Jun 23, 6:05 pm, Anonuser Anon wrote: > got this error during production (production log) > Mysql::Error (Can't connect to MySQL server o

[Rails] Re: ThreadError: stopping only thread

2010-06-23 Thread Keith Downs
Thanks Robert. I will give this a try. Regards, Keith -- 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 fr

[Rails] Re: Custom default form builder in Rails 3

2010-06-23 Thread regnever
evnironment.rb file doesn't contain any "config" instance or local variable. Edge rails documentation (Rails application configuration) suggests using: config.action_view.default_form_builder = MyBuilder inside application.rb file. I just cant figure out Where to store my modules/classes in orde

[Rails] [Rails3] Displaying the full stack trace for test errors?

2010-06-23 Thread Isak
I'm porting an app from 2.3 to 3.0, have errors in my test suite, and don't get enough info to figure out where these occur. See the example below; that's all the feedback I get for an exception raised in a view. Suggestions on how I revert to the 2.x behaviour? 1) Error: t

Re: [Rails] Custom default form builder in Rails 3

2010-06-23 Thread Christiaan Van den Poel
I gueuss it's due to the fact your 'lib/mymodule/mybuilder.rb' isn't required yet, do this in the config/environment.rb where you have the line: config.action_view.default_form_builder = Mymodule::Mybuilder C+++ On Wed, Jun 23, 2010 at 1:39 PM, regnever wrote: > Hello everyone, > > I am trying

[Rails] CSV Upload Issue

2010-06-23 Thread Pale Horse
CSV: http://pastie.org/1015772 Controller: http://pastie.org/1015773 Why is it that it's only saving the record for "EFG5"? I'm obviously missing something. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

Re: [Rails] Mysql::Error (Can't connect to MySQL server on )

2010-06-23 Thread Leonardo Mateo
On Wed, Jun 23, 2010 at 6:05 AM, Anonuser Anon wrote: > got this error during production (production log) > Mysql::Error (Can't connect to MySQL server on 'database server ip' > (110)): > > *** LOCAL GEMS *** > > actionmailer (1.2.2) >    Service layer for easy email delivery and testing. > > acti

Re: [Rails] Re: Ajax/Prototype/Scriptaculous

2010-06-23 Thread Ants Pants
Good timing, just came to check my replies. Thanks for the heads up on that, I'll give it a go. I hate frontend development!! Whatever was wrong with static HTML?!! ;) On 23 June 2010 14:16, Niels Meersschaert wrote: > You need to re-add the observers in your RJS call. If you have an observer

Re: [Rails] Re: Ajax/Prototype/Scriptaculous

2010-06-23 Thread Niels Meersschaert
You need to re-add the observers in your RJS call. If you have an observer on an element with ID foo & you replace that element (page[:foo].reload), the observer goes with it. However, depending on how your observer is setup adding to the element ie another li or a subnode, can limit the need

Re: [Rails] Re: Deploy: Developing on Windows Deploying on Linux hosting

2010-06-23 Thread Michael Pavling
On 23 June 2010 06:35, Ali Imran wrote: > Do Now I need to install Ruby on rails on my virtual machine.. > Probably; if it's not in there by default. Or you could use a full-stack that's already prepared for you. There was an email the other day about a Rails VM that was ready-to-use: http://cap

[Rails] Custom default form builder in Rails 3

2010-06-23 Thread regnever
Hello everyone, I am trying to set a default custom form builder. I have defined my form builder class in "lib/mymodule/mybuilder.rb" as: module Mymodule class Mybuilder < ActionView::Helpers::FormBuilder .. end end Then I am trying to use this custom class in application.rb as confi

Re: [Rails] Re: Ajax/Prototype/Scriptaculous

2010-06-23 Thread Ants Pants
Yeah, thanks for that. I went away yesterday and when I came back to it, I arrived at the same solution. Are you an expert with RJS? If so, I have another question. I have a select drop down list that will now be added to dynamically using RJS. But upon completion of the RJS request, all of my obs

Re: [Rails] example of an application generator template for Rails 3?

2010-06-23 Thread Peter De Berdt
On 22 Jun 2010, at 20:14, Daniel Kehoe wrote: I'd like to see an example of an application generator template for Rails 3. Any suggestions? http://railscasts.com/episodes/218-making-generators-in-rails-3 Best regards Peter De Berdt -- You received this message because you are subscribed t

[Rails] Intalll RoR on Windows XP, NOT connected to Web

2010-06-23 Thread WestCoast101
I have installed Ruby and RubyGems, latest versions from rubyonrails.com, successfully after downloading zip files. Attempting to install rails with > gem install rails gives a message that the computer [not connected to the web for security reasons] attempts to find a file. Can anyone point me t

[Rails] Re: Redirecting old URLs to new permalinked URLs

2010-06-23 Thread Lecky
Try gem rack-rewrite, that can solve your problem. Cheers, Lecky On Jun 23, 6:16 am, Joe wrote: > Bump?! Can anyone help with this? > > On 21 June, 17:11, Joe wrote: > > > Im currently in the process of adding permalinking to my site; at the > > moment I am simply testing it out in development

[Rails] Re: Re: Re: Re: Why am I onlu limited by the years from 2005-2015?

2010-06-23 Thread Abder-rahman Ali
botp wrote: > On Wed, Jun 23, 2010 at 8:50 AM, Abder-rahman Ali > wrote: >> 16: � � <%= f.date_select(:start_year=>1950, :end_year=>2010) :dob %> > > you'll need the object and method, > > http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M002264 > > kind regards -botp Tha

[Rails] Mysql::Error (Can't connect to MySQL server on )

2010-06-23 Thread Anonuser Anon
got this error during production (production log) Mysql::Error (Can't connect to MySQL server on 'database server ip' (110)): *** LOCAL GEMS *** actionmailer (1.2.2) Service layer for easy email delivery and testing. actionpack (1.12.2) Web-flow and rendering framework putting the VC in

Re: [Rails] Re: Silly little link_to question

2010-06-23 Thread Rui Carvalho
sure, if you wanted to name it ":company_id=>@company.id" then in the routes file you would have to do map.connect ':controller/:action/:company_id' or else it will interpet as one cgi query parameter regards On Tue, Jun 22, 2010 at 8:01 PM, richardsugg wrote: > Well, I got around it, b