[Rails] Re: Ajax.updater to call app_helper or model method..

2009-03-01 Thread Carlos Santana
It works fine until I start making my application RESTful way... Any clues? How can I debug this issue? Frederick Cheung wrote: On Mar 1, 2:40�am, Carlos Santana rails-mailing-l...@andreas-s.net wrote: If I use get method then it does not update the select dropdown (which is what it is

[Rails] My new (ruby, rails, random) blog.

2009-03-01 Thread Michael Graff
Yea, I hate it when people spam huge lists with random blog posts too. I've started a blogging attempt that has, so far anyway, about 90% Ruby content, most of which is directly related to Rails. Not all of it is dedicated to this, it's not that focused, but I am going to attempt to post small

[Rails] String ID - schema.rb incorrect?

2009-03-01 Thread Martin Vielsmaier
Hi, I made one of my ID columns a string, because I don't want my IDs to be guessable (I use a md5 hash of some system parameters with rehashing in case of collisions.) My migration reads: ... change_column :users, :id, :string change_column :comments, :user_id, :string Afterwards executing

[Rails] Re: i18n date formatting rails 2.2.2

2009-03-01 Thread Ronald
On Feb 28, 11:58 pm, Maurício Linhares mauricio.linha...@gmail.com wrote: They didn't worke for me either, so I rewrote the to_s method for dates and times: Date.class_eval do   def to_s( format_name = :default )     format = case format_name     when String       self.strftime( format )

[Rails] Re: beginners question

2009-03-01 Thread Gavin
Ruud - I hope you don't mind but I emailed you some material on the Prototype and Scriptaculous libraries. Might be in your junk mail box? On Feb 28, 9:18 pm, ruud r.grosm...@gmail.com wrote: Hi Gavin, I tried your suggestion; this time the javascript function isn't called at all.      

[Rails] Re: what's wrong with this applet tag (trying to get an applet rendering in a RoR page)

2009-03-01 Thread Chris Kottom
It's been a long time since I used Applets, but I think the problem is the use of CODEBASE with ARCHIVE. With CODEBASE, you're telling the browser that your code should be found as loose class files in the /applet directory rather than in the ARCHIVE. I think what you want is just: APPLET

[Rails] Re: sortable_element helper query

2009-03-01 Thread Gavin
Why not call a controller action which, in turn calls your model methods and saves? Check out Railscast 147 - Ryan explains how to create a quick sortable list: http://railscasts.com/episodes/147-sortable-lists --~--~-~--~~~---~--~~ You received this message

[Rails] Re: Undefined method 'insert_record' on ActiveRecord save

2009-03-01 Thread Heinz Strunk
I've got the same problem Undefined method 'insert_record'. Could you solve that problem? -- 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

[Rails] permalink_fu - update existing records?

2009-03-01 Thread Rails List
i am experimenting to use permalink_fu to provide clean urls. To begin with, I have installed it and made necessary changes to models, routes etc. As I have existing records in table, I wanted to update its permalink column. So in console, I gave Category.find(:all).each(:save) --as specified

[Rails] Re: Using variable class names, how?

2009-03-01 Thread ms
Thanks for your answer, I read the thread, but this did not really help me. It's not just about redefining some core methods. I think, the description of my problem was not clear enough, sorry for this. I would appreciate, if you could have a look at the following explanation. I've got several

[Rails] Re: script/console using older Rails version

2009-03-01 Thread Craig Demyanovich
Maybe at some point you put Rails 2.1.0 into vendor/rails. Anything in vendor/rails will override what you set in environment.rb and what gems you have installed. You could delete the vendor/rails directory if you don't want it, or you could try freezing your app to Rails 2.2.2 and rerunning rake

[Rails] Re: how to change sqlite3 to mysql..??

2009-03-01 Thread Hassan Schroeder
On Sat, Feb 28, 2009 at 9:26 PM, haneef5k hanee...@gmail.com wrote: Can u tell me,? which editor is best for Ruby on Rails..apps?? The one you're most proficient with :-) At various times I use jEdit, NetBeans and vi for Rails development, all reasonably cross-platform so I don't have to

[Rails] Problems using nested objects in a test

2009-03-01 Thread Heinz Strunk
Hey, I'm having some problems testing the creation of objects with nested objects. First of all, the test itself: def test_should_create_user assert_difference('User.count') do post :create, :user = { :character = characters(:user_controller_test), :username = 'test123', :password =

[Rails] Re: permalink_fu - update existing records?

2009-03-01 Thread Maurício Linhares
No one can really help you without looking at your code. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Sun, Mar 1, 2009 at 11:06 AM, Rails List rails-mailing-l...@andreas-s.net wrote: i am experimenting to use permalink_fu to provide clean

[Rails] atom_builder and link element

2009-03-01 Thread KevinJones
I'm using the atom builder to build a feed. It's mostly working but the value in the link element of each entry is not being generated as it needs to be. My url scheme looks like http://example.com/blog/nickname/id I have a controller called blog_entries and a routes.rb file which a seet of

[Rails] Re: Using variable class names, how?

2009-03-01 Thread Maurício Linhares
Sorry. but i'm completely clueless. Can't really understand what you're trying to say/do. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Sun, Mar 1, 2009 at 11:15 AM, ms m...@tzi.de wrote: Thanks for your answer, I read the thread, but this

[Rails] Re: Using variable class names, how?

2009-03-01 Thread ms
Hey, no problem, thank you for taking time! :) -- ms --~--~-~--~~~---~--~~ 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

[Rails] Re: permalink_fu - update existing records?

2009-03-01 Thread Rails List
Maurício Linhares wrote: No one can really help you without looking at your code. - Maur�cio Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Sun, Mar 1, 2009 at 11:06 AM, Rails List The question is not about my code. Its about how to use

[Rails] Re: Regular Expression question

2009-03-01 Thread pepe
Hi. I just tested the regexp against 19. and it works, but I got a little problem with the [\s\n]I just solved: s = '19. / 482.600 mm / 19.06 / 482.600 mm' s.gsub!(/(\.0?[^0])?0+/, '\1').gsub!(/\.([\s\n])/, '\1') This produces: '19 / 482.6 mm / 19.06 / 482.6 mm' The insignificant

[Rails] Ajax in Rails

2009-03-01 Thread phil7085
Hi All, New to the group, and new to learning rails. I'm having some trouble, i've done a few tutorials on creating some small apps with rails and am now starting to play around myself. I've been trying to create a simple form which when a user enters any data that data is displayed as a

[Rails] Rails Magazine - Issue #1 is now available

2009-03-01 Thread Olimpiu Metiu
I am happy to announce the very first issue of Rails Magazine! This edition has 36 pages full of quality content, is printed in glossy full-color and can be ordered in US, UK and Canada. The paper is FSC certified for minimal environment impact. The free digital edition (PDF) is well underway

[Rails] Re: Using variable class names, how?

2009-03-01 Thread Frederick Cheung
On Mar 1, 4:26 pm, ms m...@tzi.de wrote: Hey, no problem, thank you for taking time! :) Is Foo.constantize what you're looking for ? Fred -- ms --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: Problems using nested objects in a test

2009-03-01 Thread Frederick Cheung
On Mar 1, 3:31 pm, Heinz Strunk rails-mailing-l...@andreas-s.net wrote: Hey, I'm having some problems testing the creation of objects with nested objects. First of all, the test itself: def test_should_create_user   assert_difference('User.count') do     post :create, :user = {  

[Rails] Re: Ajax in Rails

2009-03-01 Thread Frederick Cheung
On Mar 1, 1:04 pm, phil7085 p@btopenworld.com wrote: I've been trying to create a simple form which when a user enters any data that data is displayed as a preview elsewhere on the page instantly, just like when creating an advert with Google Adwords, the preview is shown. I've been

[Rails] Re: Problems using nested objects in a test

2009-03-01 Thread Frederick Cheung
On Mar 1, 5:01 pm, Heinz Strunk rails-mailing-l...@andreas-s.net wrote: So there's no method to create the hash the way it'd be accepted? Sounds like a helper method... :) Well given an activerecord object then foo.attributes is a hash of attributes, however this cannot anticipate how you're

[Rails] Re: Ajax in Rails

2009-03-01 Thread phil7085
So then do I need to use the controller to populate another @advert object with all the params then render the partial? Cheers, Phil On Mar 1, 5:00 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Mar 1, 1:04 pm, phil7085 p@btopenworld.com wrote: I've been trying to create a

[Rails] Strange behavior of Source.column_names

2009-03-01 Thread Hans
I have a class named Source and a controller named SourceController etc. When I use Source.column_names in the view all names except names ending in _id is listed, although according to the documentation all names should be listed When I use Source.column_names in the source controller it

[Rails] Re: ssl certificate

2009-03-01 Thread Neeraj
Hi, Please explain , what you trying to say ? On Feb 28, 8:45 pm, Conrad Taylor conra...@gmail.com wrote: On Sat, Feb 28, 2009 at 7:28 AM, Ashikali Ashikali rails-mailing-l...@andreas-s.net wrote: Can anyone tell me which is best  either  self-signed or VeriSign certificate ?

[Rails] Re: script/console using older Rails version

2009-03-01 Thread Dantelepoole Dantelepoole
This did the trick.thanks!! Craig Demyanovich wrote: Maybe at some point you put Rails 2.1.0 into vendor/rails. Anything in vendor/rails will override what you set in environment.rb and what gems you have installed. You could delete the vendor/rails directory if you don't want it, or

[Rails] Find or select across a many to many relationship

2009-03-01 Thread johnsonmlw
I have an incident model and a pupil model, and they have a many to many relationship through an involvement model. Also, a pupil belongs to a cohort. How can I show incidents (ideally just once), in date order, where there is an involvement present from a pupil where their pupil.cohort_id == 1

[Rails] Re: Ajax in Rails

2009-03-01 Thread Frederick Cheung
On Mar 1, 5:10 pm, phil7085 p@btopenworld.com wrote: So then do I need to use the controller to populate another @advert object with all the params then render the partial? Well I don't know exactly what this controller is trying to do at all. Assuming what it's doing is create a new

[Rails] Re: Using variable class names, how?

2009-03-01 Thread Phlip
Jeff Lewis wrote: def first_last_count(clss) Note the tradition there is klass: http://google.com/codesearch?q=lang%3Aruby+klass Being 'class' is a keyword... -- Phlip --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[Rails] Re: Find or select across a many to many relationship

2009-03-01 Thread Frederick Cheung
On Mar 1, 5:52 pm, johnsonmlw johnson...@gmail.com wrote: I have an incident model and a pupil model, and they have a many to many relationship through an involvement model. Also, a pupil belongs to a cohort. How can I show incidents (ideally just once), in date order, where there is an

[Rails] Re: Ajax in Rails

2009-03-01 Thread phil7085
I am simply trying to show what the user enters somewhere else on the page as they type it. I did get it to work using render :text = param[:advert][:title] + 'br/' + param[:advert][:first_line] .. But I think there should be a more efficient way to do it? Could I do something like this:

[Rails] Re: Absolute Url with Link_to

2009-03-01 Thread peter_vandenabeele
On Mar 1, 5:21 am, tashfeen.ekram tashfeen.ek...@gmail.com wrote: i am using link_to to make links. it is gnerating urls relative to the path of the page. how do i make absolute urls. i tried using only_path but it does nto seem to work. A few ways that work for me are: link_to 'Home',

[Rails] Re: Ajax in Rails

2009-03-01 Thread Frederick Cheung
On Mar 1, 7:38 pm, phil7085 p@btopenworld.com wrote: I am simply trying to show what the user enters somewhere else on the page as they type it. I did get it to work using render :text = param[:advert][:title] + 'br/' + param[:advert][:first_line] .. But I think there should be a

[Rails] Re: Using variable class names, how?

2009-03-01 Thread Jeff Lewis
My example used clss not class, ... but sure klass if you prefer. Jeff On Mar 1, 11:32 am, Phlip phlip2...@gmail.com wrote: Jeff Lewis wrote:   def first_last_count(clss) Note the tradition there is klass:    http://google.com/codesearch?q=lang%3Aruby+klass Being 'class' is a

[Rails] Using belongs_to within instance method

2009-03-01 Thread David
Is it possible to use model associations with an instance method? For example, I have: Class Reminder belongs_to :event #and i want to access the event id within a Reminder instance method: def find_event_id id = Event.find(event_id).user.id #this works but im wondering if its possible to

[Rails] Re: Ajax in Rails

2009-03-01 Thread phil7085
Thanks Fred, How would I then need to tell rails to use the @advert object because that's the part that I have been having trouble with? Phil On Mar 1, 7:41 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Mar 1, 7:38 pm, phil7085 p@btopenworld.com wrote: I am simply trying to

[Rails] Re: Ajax in Rails

2009-03-01 Thread Frederick Cheung
On Mar 1, 8:12 pm, phil7085 p@btopenworld.com wrote: Thanks Fred, How would I then need to tell rails to use the @advert object because that's the part that I have been having trouble with? render :partial = 'blah', :object = foo Fred Phil On Mar 1, 7:41 pm, Frederick Cheung

[Rails] Re: Ajax in Rails

2009-03-01 Thread Phlip
phil7085 wrote: How would I then need to tell rails to use the @advert object because that's the part that I have been having trouble with? Formerly, it was this: def preview @advert = Advert.new(params[:advert]) render :partial = 'advert', :locals ={ :@advert = @advert } end I

[Rails] Re: Using belongs_to within instance method

2009-03-01 Thread Frederick Cheung
On Mar 1, 8:06 pm, David dly...@gmail.com wrote: Is it possible to use model associations with an instance method?  For example, I have: Class Reminder   belongs_to :event #and i want to access the event id within a Reminder instance method: def find_event_id   id =

[Rails] Re: Ajax in Rails

2009-03-01 Thread Phlip
Frederick Cheung wrote: render :partial = 'blah', :object = foo To save me from Googling for object, what does that look like inside the partial? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: Ajax in Rails

2009-03-01 Thread Frederick Cheung
On Mar 1, 8:42 pm, Phlip phlip2...@gmail.com wrote: Frederick Cheung wrote: render :partial = 'blah', :object = foo To save me from Googling for object, what does that look like inside the partial? the object specified in that way is assigned to a local variable called object and to a

[Rails] Scope of Instance Variables with Partial Views

2009-03-01 Thread Rube Noob
Hello I do not understand how to use instance variable properly with partial views, I am hoping someone here can enlighten me. For example class MainController ApplicationController def index @item_list = Item.find_all_item end def detail_display @current_selected

[Rails] Re: Ajax in Rails

2009-03-01 Thread phil7085
Thanks, I will give this a try, although as a newbie this talk of :locals, :object, etc has slightly gone over my head. I'm sure i'll get it. Phil On Mar 1, 8:37 pm, Phlip phlip2...@gmail.com wrote: phil7085 wrote: How would I then need to tell rails to use the @advert object because

[Rails] Re: Scope of Instance Variables with Partial Views

2009-03-01 Thread Frederick Cheung
On Mar 1, 8:48 pm, Rube Noob rails-mailing-l...@andreas-s.net wrote: Hello I do not understand how to use instance variable properly with partial views, I am hoping someone here can enlighten me. For example class MainController ApplicationController     def index         @item_list =

[Rails] restful_authentication issues in production

2009-03-01 Thread gaveeno
I'm not sure what's going on here, but password resets with restful_authentication aren't working in production. However, they are working in development and staging. The request to the passwords controller's create action is completing successfully according to the server log: Processing

[Rails] Re: Scope of Instance Variables with Partial Views

2009-03-01 Thread Rube Noob
Hi Fred, Thanks for your response, Basically what I am trying to accomplish is have to partial views in the index page. One for the list of items and one for the details of the selected item. In the future I hope to add new functionality to the index page and I hope that the index method

[Rails] Re: restful_authentication issues in production

2009-03-01 Thread gaveeno
I just manually set the password reset code in the DB. I then tried to reset the password and it didn't work. What's going on? On Mar 1, 1:01 pm, gaveeno gavin.to...@gmail.com wrote: I'm not sure what's going on here, but password resets with restful_authentication aren't working in

[Rails] Re: Scope of Instance Variables with Partial Views

2009-03-01 Thread Frederick Cheung
On Mar 1, 9:12 pm, Rube Noob rails-mailing-l...@andreas-s.net wrote: Hi Fred, Thanks for your response, Basically what I am trying to accomplish is have to partial views in the index page. One for the list of items and one for the details of the selected item. In the future I hope to add

[Rails] Re: Find or select across a many to many relationship

2009-03-01 Thread johnsonmlw
Oh yes. Very nice. Thanks. AR is very aware! Clever AR! -- Matt On Mar 1, 7:37 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Mar 1, 5:52 pm, johnsonmlw johnson...@gmail.com wrote: I have an incident model and a pupil model, and they have a many to many relationship through an

[Rails] Preventing read access to a model

2009-03-01 Thread Evan
In a model are there any methods that are called before providing access to the model? I'm exploring ways to enforce privileges in my app. Wondering if I can define some sort of before method in the model to prevent read access to the model unless certain conditions are true. Thanks. Evan

[Rails] Re: background process

2009-03-01 Thread rob doan
I think you can use ActiveMQ and Activemessaging plugin http://code.google.com/p/activemessaging/wiki/ActiveMessaging http://activemq.apache.org/ Frederick Cheung wrote: On 23 Feb 2009, at 10:38, Ankit Parekh wrote: Hi all I am working on a heavy engineering project. And the

[Rails] Re: before_save :strip_whitespace = saves with spaces

2009-03-01 Thread rob doan
Newb Newb wrote: Thanks for the reply. Could you tell me the way of implementation pls. How can i resolve it. Thanks in advance change line value = value.strip to: self[attr] = value.strip --~--~-~--~~~---~--~~ You received this message because

[Rails] Re: creating a rails plugin

2009-03-01 Thread rob doan
I hope this book will help you create a plugin. http://rapidshare.com/files/204193424/Addison-Wesley-Extending_Rails_Beyond_the_Core.chm.html Best regards Rob. Maurício Linhares wrote: Usually, plugins do it by using polymorphic associations, so they don't need to know in advance the real

[Rails] Re: Rails Magazine - Issue #1 is now available

2009-03-01 Thread Michael Graff
Wow, I have to admit it looks like a magazine, laying out there in the open with pictures and all. I'll check back when the pdf is available to see if it look like a USEFUL magazine. :) --Michael On Sun, Mar 1, 2009 at 10:13 AM, Olimpiu Metiu olimpiu.me...@gmail.com wrote: I am happy to

[Rails] Re: validates_uniqueness_of - how did I get two users?

2009-03-01 Thread Sarah Mei
In ActiveRecord::Base, the save method takes a flag called perform_validation, which you can set to false. Check your controller code to make sure someone didn't decide to skip the validations somewhere. On Sat, Feb 28, 2009 at 4:39 PM, phil p...@philsmy.com wrote: The odd thing is that the

[Rails] Accessing helpers within partials within helpers

2009-03-01 Thread Brendon
Hi everyone, not sure if this is a bug or just normal behaviour: From a layout file call a helper, inside that helper render a partial, inside that partial call a different helper. I find that the last helper doesn't actually get called, and when I try to inspect its class it's NilClass. Is

[Rails] Re: Preventing read access to a model

2009-03-01 Thread Rick
Go to http://api.rubyonrails.org/ read about ActiveRecord::Callbacks See also restful_authentication gem and simple_access_control plugin - use them both. On Mar 1, 12:34 pm, Evan evancha...@gmail.com wrote: In a model are there any methods that are called before providing access to the

[Rails] How to Change Up Methods According to Parameter

2009-03-01 Thread Newb Newb
Hi.. I have two methods.but the parameter will be changing. For the first method i send only one parameter(f). But for the second method i'll send 3 parameters(f,search_string_1,search_string_2). And also for 3rd Method i send Two Parameter(f,search_string). Is it possible to optimise below

[Rails] table lock

2009-03-01 Thread Vetrivel Vetrivel
How to lock a table in rails not row level lock . -- 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] How to access the binding of the caller within a method

2009-03-01 Thread Clive
Probably this is a ruby trick instead of Rails'. But the context of my question is in Rails. There are a lot of prompt to user in our Rails app. I don't want to hard-code those prompt every where, since they will be change by the product team. Then I put all of them in a yml file and load the yml

[Rails] ActiveWebService returning custom types

2009-03-01 Thread Lin Wj
class Sampleclass attr_reader :temp_arr,:temp_hash,:temp_str def initialize(temp_arr,temp_hash,temp_str) @temp_arr=temp_arr @temp_hash=temp_hash @temp_str=temp_str end class TestApi ActionWebService::API::Base api_method :get_me, :returns = [Sampleclass] end class

[Rails] Re: ActiveWebService returning custom types

2009-03-01 Thread Lin Wj
disregard this section #[get_indices(),get_stocks(),get_summary(),DateTime.now.to_s] indices = get_indices() stocks = get_stocks() summary = get_summary() current_time = DateTime.now tempsnapshot = Snapshot.new(indices,stocks,summary,current_time) tempsnapshot

[Rails] managing multiple rails applications with apache

2009-03-01 Thread --- z...@m ---
how can manage multiple rails applications with apache i have followed the following tutorial and successfullt set up my rails site using apache http://www.howtoforge.com/ruby_on_rails_debian_etch http://www.howtoforge.com/ruby_on_rails_debian_etch_p2 but how can i configure apache to host

[Rails] Error during rake db:migrate

2009-03-01 Thread Tushar Gandhi
Hi, I am using rails 2.2. I am getting an error during migration. Whenever I am running rake db:migrate, I am getting an error (in E:/Rails2.2/rails_demo) !!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. rake

[Rails] Simple Captcha setup problem

2009-03-01 Thread Zhenning Guan
$ rake simple_captcha:setup rake aborted! libMagickCore.so.1: cannot open shared object file: No such file or directory - /usr/lib/ruby/site_ruby/1.8/x86_64-linux/RMagick.so (See full trace by running task with --trace) how can I fix it? -- Posted via http://www.ruby-forum.com/.

[Rails] Phone format in Rails

2009-03-01 Thread cool
Guys, I have a text field and the name is phone I used to enter contact number. In the new form when i enter 10 digit number like 1234567890 it is displaying 1234567890 I want to display like in US format automatically like (123) 456-7890. I need to provide validation for that