Re: [Rails] Re: remember_me_for in authlogic

2010-02-10 Thread C+++
You've have to create a checkbox for this value: input type=checkbox name=usersession[remember_me] / in your erb: % form_for @user_session do |f| % % f.checkbox :remember_me, Remember me % % end % On Wed, Feb 10, 2010 at 8:57 AM, C+++ christiaan.vandenp...@gmail.comwrote: it's 'remember_me'.

[Rails] Re: redirect_to(URL) and return

2010-02-10 Thread Frederick Cheung
On Feb 10, 5:59 am, Smit Shah li...@ruby-forum.com wrote: Hi.. I am using an API. In that, I have to send data in query string. Now my question is how to get back from that site??? because it is not taking return_url from myside. It gives me response. I want to again redirect to some

[Rails] Re: ActionMailer attaching generated files

2010-02-10 Thread Frederick Cheung
On Feb 10, 5:30 am, Ryan Abbott abbot...@gmail.com wrote: Yes I am attempting to basically give it a URL, I'm not sure how else to do it.. Well you've got code to generate a pdf document, use that to save it as a temporary file and attach that temporary file to the email. Fred On Feb 1,

[Rails] help decoupling models with a foreign key relationship

2010-02-10 Thread robo
Recently started working with rails; I'm very impressed so far, but I do have a question - Say I'm running a blog-type application. I've got a Users table, and a Posts table. Each post on the blog is made by a user. The Post table has an FK user_id that keeps track of the author of the post.

[Rails] Re: Re: remember_me_for in authlogic

2010-02-10 Thread Tom Mac
Hi Thanks for the reply. What you said is right And from the doc what I understood is it sets remember_me default as 3.months. But how can we modify that? That is my question. What I need is when user check remember_me check box from view time should be set to 2 weeks (say 2 minutes as an

[Rails] Re: undefined method `generate_token'

2010-02-10 Thread RubyonRails_newbie
Ok - So should I have another line in that says: user = invitation.sender followed by @invitation.sender = @user ? Sorry - may be a daft question, but trying to get my head round it as I go. The tutorial has been trouble free until this... :-) On 10 Feb, 04:09, David furb...@gmail.com wrote:

[Rails] Generating rails app in previous version after rails 3.0 ins

2010-02-10 Thread Juanma Cervera
Hello Anybody knows how to generate a rails application in a previous version, after the installation of Rails 3.0.0.beta gem. This would work before, rails _2.3.5_ my_app but fails now with ... /usr/local/lib/site_ruby/1.8/rubygems.rb:827:in `report_activate_error': RubyGem version error:

[Rails] Re: Amending partials

2010-02-10 Thread Sharagoz --
It would help if you show us the form(s) -- 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,

[Rails] Re: How to do password expire after 15 days?

2010-02-10 Thread Sharagoz --
Your question has too wide a scope. What part are you having trouble with? Generating a new password, sending the new password by mail, or making a scheduler that resets passwords older than 15 days? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: redirect_to(URL) and return

2010-02-10 Thread Smit Shah
Frederick Cheung wrote: On Feb 10, 5:59�am, Smit Shah li...@ruby-forum.com wrote: % @url = www.abc.com/api?name=data % % response = redirect_to(@url) % % if response == true % � % redirect_to :action = 'success' % % else % � % redirect_to :action = 'failure' % % end % First off, this

[Rails] Re: help decoupling models with a foreign key relationship

2010-02-10 Thread Sharagoz --
class Post belongs_to :user end Then you can do post.user.name retrieve the name of the author of the post -- 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

[Rails] Re: text_field instead of a collection_select

2010-02-10 Thread eugenio
i tried the plugin you suggested, which seems exactly what i'm looking for. but i got stuck: my user model has this line belongs_to :cap_residenza, :class_name = 'Cap' and i added accepts_nested_reference_and_attributes_for :cap_residenza, :codice, :required = true in the form view i added

[Rails] Re: validation problems

2010-02-10 Thread Sharagoz --
validates_size_of :value, :is=9, :message=must be 5-digit number, :if=Proc.new{|u| u.value.is_a?(Numeric)} Looks corrent to me. Maybe the name of the field value is causing a conflict somewhere. Try to rename the field to something else just to test. -- Posted via http://www.ruby-forum.com/.

[Rails] Re: text_field instead of a collection_select

2010-02-10 Thread Erol Fornoles
On Feb 10, 6:50 pm, eugenio eugenio.mode...@gmail.com wrote: i tried the plugin you suggested, which seems exactly what i'm looking for. but i got stuck: my user model has this line   belongs_to :cap_residenza, :class_name = 'Cap' and i added accepts_nested_reference_and_attributes_for

[Rails] Re: How to do password expire after 15 days?

2010-02-10 Thread Maycon Felici
Hi Sharagoz, In realy nothing was made yet but i'm searching the best to do that. I will try explain again. My application have any resources that i need to share with others users, for example CVs, but i need release the access by send data like password and login by email, and ensure validity

Re: [Rails] Generating rails app in previous version after rails 3.0 ins

2010-02-10 Thread Conrad Taylor
On Wed, Feb 10, 2010 at 2:07 AM, Juanma Cervera li...@ruby-forum.comwrote: Hello Anybody knows how to generate a rails application in a previous version, after the installation of Rails 3.0.0.beta gem. This would work before, rails _2.3.5_ my_app but fails now with ...

[Rails] Insert into table without his model

2010-02-10 Thread Tushar Gandhi
Hi, I have contacts table. I have to insert and update contacts table. Is that be possible to do this without having the contact.rb model? Can I make direct interaction to the contacts table? Can anyone help me out? Thanks, Tushar Gandhi -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: Insert into table without his model

2010-02-10 Thread Frederick Cheung
On Feb 10, 12:53 pm, Tushar Gandhi li...@ruby-forum.com wrote: Hi, I have contacts table. I have to insert and update contacts table. Is that be possible to do this without having the contact.rb model? Can I make direct interaction to the contacts table? Well

[Rails] Re: Insert into table without his model

2010-02-10 Thread Tushar Gandhi
Thanks Fred, Actually my contacts table is in other database. Means I have two databases development1 and development2. My main database is development1. My contacts table reside in development2. So I have writtes like this establish_connection(:development2)

[Rails] Re: Insert into table without his model

2010-02-10 Thread Sharagoz --
Is there a good reason you want to skip the model? if contact.rb looks like this: class Contact ActiveRecord::Base establish_connection(:development2) end then you can do this in the controller= @contact = Contact.find(1) and it will fetch contacts from development 2. -- Posted via

[Rails] On-line Quizzes: any Rails gem orplugin ?

2010-02-10 Thread Giorgio Robino
Hi all! my first post here; Does exist any Rails plugin or gem do realize something in this application area: Course Management System, Learning Management System, Virtual Learning Environment ? More specifically: I'm looking for a web app framework to realizze ON-LINE QUIZ

[Rails] Re: help decoupling models with a foreign key relationship

2010-02-10 Thread robo
That's handy! Does that work too if I say class Post has_one :user end I guess the real question is - what's the difference between has_one and belongs_to? On Feb 10, 4:44 am, Sharagoz -- li...@ruby-forum.com wrote: class Post   belongs_to :user end Then you can do post.user.name

[Rails] Re: redirect_to(URL) and return

2010-02-10 Thread Sharagoz --
You need to send a http request in the controller action and use that info to redirect the user. require 'net/http' connection = Net::HTTP.new(www.google.com) response = connection.start do |http| req = Net::HTTP::Get.new(/#hl=ensource=hpq=ruby+on+railsaq=faqi=g10oq=fp=c26c79a56c95bda8)

[Rails] Re: help decoupling models with a foreign key relationship

2010-02-10 Thread Marnen Laibow-Koser
robo wrote: That's handy! Does that work too if I say class Post has_one :user end I guess the real question is - what's the difference between has_one and belongs_to? The location of the foreign key. Go read the Associations docs. Best, --  Marnen Laibow-Koser

[Rails] Re: Generating rails app in previous version after rails 3.0

2010-02-10 Thread Marnen Laibow-Koser
Conrad Taylor wrote: On Wed, Feb 10, 2010 at 2:07 AM, Juanma Cervera li...@ruby-forum.comwrote: /usr/local/lib/site_ruby/1.8/rubygems.rb:827:in `report_activate_error': RubyGem version error: railties(3.0.0.beta not = 2.3.5) (Gem::LoadError) from

Re: [Rails] Re: help decoupling models with a foreign key relationship

2010-02-10 Thread Mat Brown
belongs_to means the foreign key is an attribute of this model. has_one/has_many means it's an attribute of the associated model. On Feb 10, 2010 8:47 AM, robo chase.delanguille...@gmail.com wrote: That's handy! Does that work too if I say class Post has_one :user end I guess the real

Re: [Rails] absolute url to images from the model?

2010-02-10 Thread Mat Brown
Your data model layer should not be aware of application state (or even assume it is part of a web app). So, this should be done from the controller/view layer. On Feb 10, 2010 2:45 AM, lunaclaire szager...@gmail.com wrote: I have a need to pass full, absolute urls to images for an interaction

Re: [Rails] Re: Rails System Commad

2010-02-10 Thread Mat Brown
If you need to run commands in the background, a message queue is the way to go. Resque and resque-status offer you some ability to check in on the progress of background jobs, though if you're shelling out you'd still need to have some way for your background worker to monitor the (forked)

Re: [Rails] Re: Generating rails app in previous version after rails 3.0

2010-02-10 Thread Conrad Taylor
On Wed, Feb 10, 2010 at 6:09 AM, Marnen Laibow-Koser li...@ruby-forum.comwrote: Conrad Taylor wrote: On Wed, Feb 10, 2010 at 2:07 AM, Juanma Cervera li...@ruby-forum.comwrote: /usr/local/lib/site_ruby/1.8/rubygems.rb:827:in `report_activate_error': RubyGem version error:

[Rails] Can't pass parameters in routes on Rails 3

2010-02-10 Thread Henrique Testa
Hi all! In Rails 2.3, I could do the following: map.connect /posts/favorites, :controller = :posts, :action = :index, :filter = favorites But it seems that the match command in Rails 3 doesn't accept parameters. So, the following doesn't work: match /posts/favorites = posts#index, :filter =

Re: [Rails] Re: Re: remember_me_for in authlogic

2010-02-10 Thread Conrad Taylor
class UserSession Authlogic::Session::Base def remember_me_for 2.minutes end end Next, I would recommend looking at your cookies to verify that session cookie is properly created and expired. Good luck, -Conrad -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Re: some success at last, and some questions

2010-02-10 Thread Bigos
class ContactsController ApplicationController   def index     �...@current_tab = 'Contact Us'   end end in a helper, probably application_helper.rb def tab_link(tab_name, target)    link_to(tab_name, target, :class = tab_name == @current_tab ? 'current_tab' : 'jtab') end Is it OK

[Rails] one rails, multiple DBs

2010-02-10 Thread Marcelo Barbudas
Hi. I'm in a situation where I have to provide a hosted Rails App solution. I'm running Apache with passenger in the backend. What is the proper way to change the DB depending on the subdomain? Should I use data_fabric? -- R. -- You received this message because you are subscribed to the

[Rails] Re: one rails, multiple DBs

2010-02-10 Thread Marnen Laibow-Koser
Marcelo Barbudas wrote: Hi. I'm in a situation where I have to provide a hosted Rails App solution. I'm running Apache with passenger in the backend. What is the proper way to change the DB depending on the subdomain? Should I use data_fabric? Generally, you don't need a separate DB for

[Rails] AJAX responses

2010-02-10 Thread Bob
Does anyone know if it's possible to do multiple AJAX responses to a single request in Rails? I did some googling but didn't find anything extremely helpful. Thanks. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group,

[Rails] Re: AJAX responses

2010-02-10 Thread Marnen Laibow-Koser
Bob wrote: Does anyone know if it's possible to do multiple AJAX responses to a single request in Rails? I did some googling but didn't find anything extremely helpful. What do you mean? One HTTP request gets one response. That's the way the protocol works Thanks. Best, --  Marnen

Re: [Rails] DB query cache

2010-02-10 Thread Marc Byrd
This is an excellent use case for CloudCache - which has introspection, so you can tell what's in cache when... Implements ActiveSupport::Cache, so if you're already using that, it's a coupla lines of change. See getCloudCache.com Cheers, m On Tue, Feb 9, 2010 at 4:41 PM, Tristan

Re: [Rails] Re: AJAX responses

2010-02-10 Thread Peter De Berdt
On 10 Feb 2010, at 17:18, Marnen Laibow-Koser wrote: Does anyone know if it's possible to do multiple AJAX responses to a single request in Rails? I did some googling but didn't find anything extremely helpful. What do you mean? One HTTP request gets one response. That's the way the

[Rails] Re: absolute url to images from the model?

2010-02-10 Thread Paul Harrington
Mat Brown wrote: Your data model layer should not be aware of application state (or even assume it is part of a web app). So, this should be done from the controller/view layer. On Feb 10, 2010 2:45 AM, lunaclaire szager...@gmail.com wrote: I have a need to pass full, absolute urls to

[Rails] Re: Inserting Javascript dinamically with DOM

2010-02-10 Thread Yuri Albuquerque
Why not just call the script file from a script tag instead of replace_html? In general, your JavaScript should be coming from static external files. Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Well, now I tried. I have tried this on my view: script

[Rails] Re: absolute url to images from the model?

2010-02-10 Thread Paul Harrington
Mat Brown wrote: Your data model layer should not be aware of application state (or even assume it is part of a web app). So, this should be done from the controller/view layer. More regards to this: I am *deathly afraid* of communicating with web services during my apps' request/response

[Rails] Re: Action Web Service : Missing template wsdl.rhtml

2010-02-10 Thread Kirill Necrasov
Lucas Hills wrote: module SOAP SOAPNamespaceTag = 'env' XSDNamespaceTag = 'xsd' XSINamespaceTag = 'xsi' end Big thnx, this works! -- 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

[Rails] Re: Inserting Javascript dinamically with DOM

2010-02-10 Thread Marnen Laibow-Koser
Yuri Albuquerque wrote: Why not just call the script file from a script tag instead of replace_html? In general, your JavaScript should be coming from static external files. Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Well, now I tried. I have tried this

[Rails] undefined method 'state'

2010-02-10 Thread John Merlino
I can't imagine what I'm trying to do is complicated at all in Rails. Yet, I am now getting this error: undefined method `state' for :StudentFailState:Symbol. student.rb has_one :student_fail attr_accessor :student_fail_attribute #controller def student_fail @student = @student.find params[:id]

[Rails] Re: undefined method 'state'

2010-02-10 Thread John Merlino
This gives undefined method join error: form_for @student do |f| f.collection_select(:student_fail_attribute, StudentFailState.all, :id, :key) end -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group.

[Rails] Re: undefined method 'state'

2010-02-10 Thread Marnen Laibow-Koser
John Merlino wrote: I can't imagine what I'm trying to do is complicated at all in Rails. Yet, I am now getting this error: undefined method `state' for :StudentFailState:Symbol. student.rb has_one :student_fail attr_accessor :student_fail_attribute #controller def student_fail

[Rails] Re: one rails, multiple DBs

2010-02-10 Thread Marcelo Barbudas
Hi, Generally, you don't need a separate DB for each subdomain.  One big DB is usually better. It's a high volume app, that's written as a standalone service. Extending it as a hosted solution and keeping updates nice is a big part of what the project is about. -- Cheers, M. -- You received

[Rails] Re: one rails, multiple DBs

2010-02-10 Thread Marnen Laibow-Koser
Marcelo Barbudas wrote: Hi, Generally, you don't need a separate DB for each subdomain. �One big DB is usually better. It's a high volume app, that's written as a standalone service. Extending it as a hosted solution and keeping updates nice is a big part of what the project is about.

Re: [Rails] Re: absolute url to images from the model?

2010-02-10 Thread Mat Brown
On Wed, Feb 10, 2010 at 11:39, Paul Harrington li...@ruby-forum.com wrote: Mat Brown wrote: Your data model layer should not be aware of application state (or even assume it is part of a web app). So, this should be done from the controller/view layer. More regards to this: I am *deathly

[Rails] Re: one rails, multiple DBs

2010-02-10 Thread Marcelo Barbudas
Hi. It's a high volume app, that's written as a standalone service. Extending it as a hosted solution and keeping updates nice is a big part of what the project is about. And all of that would be easier with one big DB, at least as far as you've described. You are right, it would

[Rails] undefined method join

2010-02-10 Thread JohnMerlino
Hey all, I get an undefined method `join' for #String NoMethodError. student.rb has_one :student_fail attr_accessor :student_fail_attribute #controller def student_fail @student = @student.find params[:id] def update_student_fail @student.build_student_fail

[Rails] Re: one rails, multiple DBs

2010-02-10 Thread myobie
DataMapper out of the box will let you use multiple databases, although these need to be known at app boot time. For ActiveRecord, this article might lead you somewhere: http://tomayko.com/writings/rails-multiple-connections Nathan On Feb 10, 1:34 pm, Marcelo Barbudas nos...@gmail.com wrote:

[Rails] nil object - can anyone help?

2010-02-10 Thread RubyonRails_newbie
Hi there, I've been looking for a while now and can't seem to find where I'm going wrong.. I'm following a railscast tutorial to send invites out to people. there's n invitation.rb page: class Invitation ActiveRecord::Base #attr_accessible :sender_id, :recipient_email, :token, :sent_at

[Rails] Re: AJAX responses

2010-02-10 Thread Bob
I have a class that compares invoice totals for a month and calculates the dollars saved. The downside is it takes about 1 second per invoice per month to calculate so it's taking a considerable amount of time to display a complete report especially if you run it for a two year period (48

[Rails] Re: nil object - can anyone help?

2010-02-10 Thread Robert Walker
Craig Westmoreland wrote: THis page, for some odd reason will not render. Instead I get: You have a nil object when you didn't expect it! The error occurred while evaluating nil. Can anyone see the obvious mistake? I could do with a fresh pair of eyes on this... :-) Have you looked at your

[Rails] Re: absolute url to images from the model?

2010-02-10 Thread lunaclaire
Thx for the replies, Mat and Paul. I agree w Paul in this case. The model is responsible for the communication w FB as part of a cross-posting step that is part of the business logic. So, that's where I'm putting this. And it kinda works... it *does* work as far as being able to call image_path

[Rails] Re: nil object - can anyone help?

2010-02-10 Thread RubyonRails_newbie
yeah - it's complaining about the @user in % if @user.invitation_limit 0 % %= link_to 'Send invitation!', new_invitation_path % % end % I've tried renaming it with just user, then

Re: [Rails] Re: nil object - can anyone help?

2010-02-10 Thread Steve Klabnik
I don't see you defining @user anywhere. Which view is your code in? -- 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

[Rails] Re: nil object - can anyone help?

2010-02-10 Thread RubyonRails_newbie
my view is in the main layouts file. I also tried to add @invitation.sender = @user to the invitations controller but that hasn't solved it... On 10 Feb, 19:24, Steve Klabnik steve.klab...@gmail.com wrote: I don't see you defining @user anywhere. Which view is your code in? -- You received

Re: [Rails] Re: nil object - can anyone help?

2010-02-10 Thread Steve Klabnik
Your application.html.erb? Then yeah, you're going to need @user defined in every controller. Also, is this a user that was created before you added in your invitations? If so, you won't have anything for an invitation_limit for any of your users, you'll want to do a User.all.each{|user|

[Rails] Re: nil object - can anyone help?

2010-02-10 Thread RubyonRails_newbie
in that case, would it make more sense to add it to a page when a user is already logged in? I've just tried adding it to the invitation's index page, and i get the same issue... sorry On 10 Feb, 19:45, Steve Klabnik steve.klab...@gmail.com wrote: Your application.html.erb? Then yeah,

[Rails] Re: nil object - can anyone help?

2010-02-10 Thread Marnen Laibow-Koser
Craig Westmoreland wrote: my view is in the main layouts file. I also tried to add @invitation.sender = @user to the invitations controller but that hasn't solved it... Of course. It's @user that's coming up nil in the first place. Best, --  Marnen Laibow-Koser http://www.marnen.org

[Rails] Re: nil object - can anyone help?

2010-02-10 Thread Marnen Laibow-Koser
Craig Westmoreland wrote: in that case, would it make more sense to add it to a page when a user is already logged in? Heck yes. I've just tried adding it to the invitation's index page, and i get the same issue... sorry Best, --  Marnen Laibow-Koser http://www.marnen.org

[Rails] Re: nil object - can anyone help?

2010-02-10 Thread RubyonRails_newbie
Hmmm.. It's still not working, even when I've added it in the invitations view page. :-( On 10 Feb, 20:02, Marnen Laibow-Koser li...@ruby-forum.com wrote: Craig Westmoreland wrote: in that case, would it make more sense to add it to a page when a user is already logged in? Heck yes.

[Rails] Re: On-line Quizzes: any Rails gem orplugin ?

2010-02-10 Thread RaW
I've never seen any plugin or gem like that. Some time ago I created a simple online examination app with Rails. You can play around with it here http://rexaminator.com If you have any questions and think I can help please let me know. -- Rafal -- You received this message because you are

[Rails] Transaction not rolled back in Functional Test

2010-02-10 Thread Homer Simpson
Using rails 2.3 and MySQL 5. I have code in a controller that is something like begin User.transaction do user_object.save do something that might raise an exeception end rescue Log the error give the user the form to try again end It works perfectly when the functionality is

[Rails] namespace + nested resources = % form_for ... % problem

2010-02-10 Thread Alex Shkolnikov
Hello all I wrote a gist, which describes my problem: http://gist.github.com/300860 What param I need to pass to form_for? Thanks -- 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: nil object - can anyone help?

2010-02-10 Thread RubyonRails_newbie
ok - i've managed to get the following to render correctly (from within the application.html.erb file: % if @user.invitation_limit 0 % %= link_to 'Send invite', :controller = 'invitations', :action

[Rails] Re: Problem with before_* callbacks being wrapped in transac

2010-02-10 Thread iwars...@stripey.net
Won't this savepoint also be rolled back? Also, I am not storing any credit card numbers, cvv, etc. Basically the last 4 digits, decline code, etc. On Feb 9, 2:33 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: iwars...@stripey.net wrote: I am upgrading a 2.1 Rails app and ran into a

Re: [Rails] Re: nil object - can anyone help?

2010-02-10 Thread Steve Klabnik
considering it's user.invitation_limit, (or maybe @user), that means you need to define one or the other. -- 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

[Rails] Re: nil object - can anyone help?

2010-02-10 Thread RubyonRails_newbie
Yeah - I have @ user defined in the view and the controller On 10 Feb, 22:01, Steve Klabnik steve.klab...@gmail.com wrote: considering it's user.invitation_limit, (or maybe @user), that means you need to define one or the other. -- You received this message because you are subscribed to

[Rails] Re: Problem with before_* callbacks being wrapped in transac

2010-02-10 Thread Marnen Laibow-Koser
Please quote when replying. iwars...@stripey.net wrote: Won't this savepoint also be rolled back? Why don't you try it and find out? Also, I am not storing any credit card numbers, cvv, etc. Basically the last 4 digits, decline code, etc. Check your merchant agreement. I'm no expert, but

[Rails] Tagging plugin ?

2010-02-10 Thread Erwin
which recent plugin could be the best to handle a simple marketing campaign ads app based on user profile tags ? don't need sophisticated things : - user profile - tags created -marketing campaign - targets - tag selection (from tags list) thanks for your update (Rails 2.3.5 / Ruby 1.8.7 moving

[Rails] Re: namespace + nested resources = % form_for ... % problem

2010-02-10 Thread Alex Shkolnikov
I've found a solution and updated my gist, if anyone interested. On Feb 11, 12:28 am, Alex Shkolnikov alex.shkolni...@gmail.com wrote: Hello all I wrote a gist, which describes my problem:http://gist.github.com/300860 What param I need to pass to form_for? Thanks -- You received this

[Rails] Re: validation problems

2010-02-10 Thread Ichiro Saga
Sharagoz -- wrote: validates_size_of :value, :is=9, :message=must be 5-digit number, :if=Proc.new{|u| u.value.is_a?(Numeric)} Looks corrent to me. Maybe the name of the field value is causing a conflict somewhere. Try to rename the field to something else just to test. Thanks Sharagoz. I

[Rails] Re: nil object - can anyone help?

2010-02-10 Thread Jarin Udom
Are you defining @user in application_controller.rb? I don't see it defined anywhere in the code you posted. If you're using an authentication plugin, you probably want to do something like: @user = current_user Even then, you'll have to check to see if current_user is nil, unless that page is

[Rails] CRUD pattern for modals

2010-02-10 Thread Rodrigo Dominguez
I have an application, where i.e., I can go to the users controllers, and they manage all the basic actions by rest, like creating, modifying, updating and deleting records. Now, I want to reuse that code, from another part in the web page, so I can list the users on that other controller, and if

[Rails] Sql update_all with string concatenate

2010-02-10 Thread Pito Salas
From a migration. I want to initialize a new column called ident with a string equal to prec-#{id} - where id is meant to be the id column of the relevant row. This works: Precinct.update_all(ident = 'prec-' || id ) I am confused about whether that bit of SQL is being parsed by Rails code,

[Rails] Re: Console not working

2010-02-10 Thread Trausti Thor Johannsson
This seems to be contagious as now my Mac and other linux boxes that I know have worked, don't work any more. When I start script/console, I get the prompt but no application objects, no models, no database. What am I doing that is so wrong that the application it self works like a charm, but I

Re: [Rails] Sql update_all with string concatenate

2010-02-10 Thread Philip Hallstrom
From a migration. I want to initialize a new column called ident with a string equal to prec-#{id} - where id is meant to be the id column of the relevant row. This works: Precinct.update_all(ident = 'prec-' || id ) I am confused about whether that bit of SQL is being parsed by Rails code,

[Rails] Re: Sql update_all with string concatenate

2010-02-10 Thread Marnen Laibow-Koser
Philip Hallstrom wrote: From a migration. I want to initialize a new column called ident with a string equal to prec-#{id} - where id is meant to be the id column of the relevant row. This works: Precinct.update_all(ident = 'prec-' || id ) I am confused about whether that bit of SQL

[Rails] Re: Console not working

2010-02-10 Thread Marnen Laibow-Koser
Trausti Thor Johannsson wrote: This seems to be contagious as now my Mac and other linux boxes that I know have worked, don't work any more. When I start script/console, I get the prompt but no application objects, no models, no database. What am I doing that is so wrong that the

Re: [Rails] validation problems

2010-02-10 Thread Conrad Taylor
On Tue, Feb 9, 2010 at 4:03 PM, Ichiro Saga li...@ruby-forum.com wrote: Hi, there. I have two validations in the model: validates_numericality_of :value, :only_integer=true, :allow_blank=true validates_size_of :value, :is=9, :message=must be 5-digit number, :if=Proc.new{|u|

[Rails] Re: Sql update_all with string concatenate

2010-02-10 Thread Pito Salas
Marnen Laibow-Koser wrote: To the OP: if this column is just going to be the id with a constant prefix, then you don't need it in the DB! It's initializing existing records in a migration. Over time the match will not be present. To the other point about || meaning concatenation. Thats what

Re: [Rails] Re: Sql update_all with string concatenate

2010-02-10 Thread Philip Hallstrom
On Feb 10, 2010, at 4:31 PM, Pito Salas wrote: Marnen Laibow-Koser wrote: To the OP: if this column is just going to be the id with a constant prefix, then you don't need it in the DB! It's initializing existing records in a migration. Over time the match will not be present. To the other

[Rails] Error when starting rails server [on rails 3]

2010-02-10 Thread Joep Arts
Hi all, I receive an error when starting the server, namely: ~/Documents/blog$ rails server /usr/local/lib/site_ruby/1.8/rubygems.rb:827:in `report_activate_error': RubyGem version error: rack-mount(0.5.0 not ~ 0.4.0) (Gem::LoadError) from /usr/local/lib/site_ruby/1.8/rubygems.rb:261:in

[Rails] when does 'dog' not equal 'dog'?

2010-02-10 Thread fearless_fool
This is more a Ruby than a Rails question -- feel free to redirect me as appropriate -- but either this is a Ruby 1.9 bug or I have some serious misunderstanding. Essentially, I've caught the = operator returning nil -- not -1, 0, or 1, but nil. Schematically: class A attr_accessor :slot

Re: [Rails] Error when starting rails server [on rails 3]

2010-02-10 Thread Greg Donald
On Wed, Feb 10, 2010 at 6:56 PM, Joep Arts li...@ruby-forum.com wrote: RubyGem version error: rack-mount(0.5.0 not ~ 0.4.0) (Gem::LoadError) gem install rack-mount -v=0.4.0 -- Greg Donald destiney.com | gregdonald.com -- You received this message because you are subscribed to the Google

Re: [Rails] when does 'dog' not equal 'dog'?

2010-02-10 Thread Mat Brown
You'll want to hit the ruby-talk list with this question. On Feb 10, 2010 7:58 PM, fearless_fool rdp...@gmail.com wrote: This is more a Ruby than a Rails question -- feel free to redirect me as appropriate -- but either this is a Ruby 1.9 bug or I have some serious misunderstanding.

[Rails] Re: when does 'dog' not equal 'dog'?

2010-02-10 Thread Paul Harrington
fearless_fool wrote: This is more a Ruby than a Rails question -- feel free to redirect me as appropriate -- but either this is a Ruby 1.9 bug or I have some serious misunderstanding. Essentially, I've caught the = operator returning nil -- not -1, 0, or 1, but nil. Schematically: class A

[Rails] Parameterized ActiveRecord Associations: Any such thing?

2010-02-10 Thread Kendall Gifford
Hi list, how are ya? So, my current project is just begging for the ability to have parameterized associations in my ActiveRecord classes. Basically I need something that is a cross between named scopes and standard associations (has_many specifically). I'm wondering if such a thing exists or,

[Rails] Model not found in custom script...

2010-02-10 Thread Frank_in_Tennessee
Hello, I have a custom task_scheduler.rb file in RAILS_ROOT/configuration/ initializers. It fails because I think that it doesn't know where to find my Category model. Do you know how I can load or have available the resources/environment that myrails app uses into this script? Thanks, Frank

[Rails] Re: when does 'dog' not equal 'dog'?

2010-02-10 Thread fearless_fool
Can't reproduce with what you've given. ruby-1.9.1-p376 class A ruby-1.9.1-p376 ?  attr_accessor :slot ruby-1.9.1-p376 ?  def matches? s ruby-1.9.1-p376 ?    puts s = @slot = #{s = @slot} ruby-1.9.1-p376 ?    (s = @slot) == 0 ruby-1.9.1-p376 ?    end ruby-1.9.1-p376 ?  end  = nil

[Rails] Re: Parameterized ActiveRecord Associations: Any such thing?

2010-02-10 Thread Erol Fornoles
On Feb 11, 9:25 am, Kendall Gifford zettab...@gmail.com wrote: Hi list, how are ya? So, my current project is just begging for the ability to have parameterized associations in my ActiveRecord classes. Basically I need something that is a cross between named scopes and standard associations

[Rails] Re: Parameterized ActiveRecord Associations: Any such thing?

2010-02-10 Thread Kendall Gifford
On Feb 10, 7:27 pm, Erol Fornoles erol.forno...@gmail.com wrote: Named scopes are already sufficient for what you're trying to achieve: class Sprocket   named_scope :versioned, lambda { |version| {:conditions = {:version = version}} } end

[Rails] Act_as_Solr

2010-02-10 Thread mahesh s
Hi friends Im newbie act as solr, give me some ideas how to use the plugin act as solr and give some example also -- 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] Act_as_Solr

2010-02-10 Thread Mat Brown
http://github.com/outoftime/sunspot (Yep, shameless plug) On Feb 10, 2010 9:57 PM, mahesh s mahesh...@gmail.com wrote: Hi friends Im newbie act as solr, give me some ideas how to use the plugin act as solr and give some example also -- You received this message because you are subscribed

[Rails] Re: show/hide some few fields according to a value selected

2010-02-10 Thread pepe
Hola. Antes de nada, que no te sorprenda si empiezas a recibir respuestas diciendo que este grupo es en inglés sólo. ;) Lo que quieres hacer se puede hacer con Javascript. Hay un libro muy bueno que no sé si se ha traducido al español, aunque me imagino que sí. En inglés se titula Ajax on Rails.

[Rails] Re: CRUD pattern for modals

2010-02-10 Thread Adam Stegman
The popup sounds like some AJAX. You can create JavaScript views for your actions (action.js.erb) and use XHR with an Accept: text/ javascript header to get those views (probably users/index.js.erb and users/new.js.erb), and do the popup etc. within that. Similar course of action for

[Rails] Re: Re: Re: remember_me_for in authlogic

2010-02-10 Thread Tom Mac
Hi Conrad Thanks. It perfectly worked Tom -- 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

  1   2   >