Re: [Rails] Re: Oh no! I have a Spec model

2010-01-27 Thread Ease Bus
Thanks Marnen! I will surely look into back references next time. Before I got your answer, I managed to do this manually by replacing Spec then spec when preceded with each of the special characters: @ : ' / - ! space. I downloaded and used Name Mangler to replace spec in file names. While

[Rails] We Need a Ruby Developer

2010-01-27 Thread BCK
We have about a dozen enhancements for a high-profile, highly- trafficked website that was written almost exclusively in Ruby on Rails. However previous project posts on guru.com and other sites have failed to produce a large number of applicants (let alone qualified applicants). Can anyone in

Re: [Rails] has_many, through with nested models?

2010-01-27 Thread Colin Law
2010/1/27 lunaclaire szager...@gmail.com: First the data model: class Forum ActiveRecord::Base        has_many                :topics, :dependent = :destroy, :order = 'created_at desc' end class User ActiveRecord::Base        has_many                :topics, :dependent = :destroy    

[Rails] Re: Time taken by page to load

2010-01-27 Thread Frederick Cheung
On Jan 27, 6:23 am, Hemant Bhargava li...@ruby-forum.com wrote: But how can i do it? Where does rails do it? I want to write a summary like user with session id is accessing page ABC, have taken abc time.. etc etc. in a sinle line of log files .. By default log files go into your app's log

Re: [Rails] Test that a string is not displayed in view

2010-01-27 Thread Colin Law
2010/1/26 Vincent P ease...@gmail.com: How can I test that a view does not display a particular string any where? E.g., the particular string is I should not be here.  In my controller test, I have: assert_select div, /I should not be here/, false assert_select div, {:text = /I should not

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread radu puspana
On Jan 26, 10:05 pm, Alpha Blue li...@ruby-forum.com wrote: I've written a complete custom built gui search engine in C++, and I'm also in the process of building a new GUI search engine for ruby.  In order to understand google's references, you have to look at their API.

[Rails] Calling a models function via a link

2010-01-27 Thread brianp
Hey, If i have a function in my model: def mark_sold self.update_attribute(:market_status, 'sold') end Is it possible for this to be called via an on page link? Then I'd like to ajax it so a user could just scroll down a list clicking all links to mark as sold as he comes across old

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread Frederick Cheung
On Jan 27, 9:16 am, radu puspana radupusp...@gmail.com wrote: It seems pretty simple but it's not.  You should make sure that you enforce URI encoding standards when submitting your URLs. What does this mean You should make sure that you enforce URI encoding standards when submitting your

Re: [Rails] Calling a models function via a link

2010-01-27 Thread Jeffrey L. Taylor
Quoting brianp brian.o.pea...@gmail.com: Hey, If i have a function in my model: def mark_sold self.update_attribute(:market_status, 'sold') end Is it possible for this to be called via an on page link? Then I'd like to ajax it so a user could just scroll down a list clicking

[Rails] Re: Calling a models function via a link

2010-01-27 Thread brianp
Thanks Jeffrey, I had a good feeling this is how it needed to be done. But felt like I was bloating my controller. Now I'm happy knowing I was originally going in the right direction. Thanks again. brianp On Jan 27, 2:10 am, Jeffrey L. Taylor r...@abluz.dyndns.org wrote: Quoting brianp

Re: [Rails] Re: testing errors

2010-01-27 Thread Colin Law
2010/1/27 Vishwa Rao li...@ruby-forum.com: Thank you. Yes 'assert_session_has' and 'assert_session_has_no'  has been replaced by 'assert_nil session' Now I am getting another error: Error: test_bad_signup(UserControllerTest): NoMethodError: You have a nil object when you didn't expect

[Rails] A more graceful friendly url method?

2010-01-27 Thread brianp
Hey, I'm almost done a project and only now am I implementing friendly URLs. I'm using the method from Simply Rails 2 by Patrick Lenz. This involves the following addition to the model: def to_param #{id}-#{name}.gsub(/\W/, '-').downcase end So every time a url

[Rails] globalization using tzinfo

2010-01-27 Thread Pavan Agrawal
Hi Gurus, I want to globalize my project using tzinfo. I want to: 1. use tzinfo to globalize my app. 2. the app is already developed, so what is the accurate solution to implement it using minimal and centralize change. 3. I have heard that tzinfo have some issues

[Rails] I need some help

2010-01-27 Thread kevid
I can't start webrick from the command line. always have this error below. Some one help, please. C:\Users\imedia1\applicaruby script/server = Booting WEBrick = Rails 2.3.5 application starting on http://0.0.0.0:3000 = Call with -d to detach = Ctrl-C to shutdown server [2010-01-25 13:45:26]

Re: [Rails] I need some help

2010-01-27 Thread Pavan Agrawal
is IIS already installed? Regards, Pavan Agrawal On Wed, Jan 27, 2010 at 2:48 PM, kevid alumsimport...@yahoo.ca wrote: I can't start webrick from the command line. always have this error below. Some one help, please. C:\Users\imedia1\applicaruby script/server = Booting WEBrick = Rails

[Rails] Re: Updating column (migration)

2010-01-27 Thread eggie5
thank you this was the trick On Jan 26, 6:15 pm, Simon Macneall macne...@gmail.com wrote: Seehttp://guides.rubyonrails.org/migrations.html, particularly the   change_column command Simon On Tue, 26 Jan 2010 17:11:41 +0800, eggie5 egg...@gmail.com wrote: I have a column in a postgres

[Rails] around_filter and with_scope

2010-01-27 Thread eugenio
i got two controller (with restful actions) where my code is quite ugly and not very dry. every action looks quite like this: if @logged_user.has_role?(admin) User.find(params[:id) else @logged_user.group.user.find(params[:id]) this is a security check that enforce a simple spec: normal user

Re: [Rails] around_filter and with_scope

2010-01-27 Thread Frederick Cheung
On 27 Jan 2010, at 11:32, eugenio wrote: i got two controller (with restful actions) where my code is quite ugly and not very dry. every action looks quite like this: if @logged_user.has_role?(admin) User.find(params[:id) else @logged_user.group.user.find(params[:id]) this is a

Re: [Rails] We Need a Ruby Developer

2010-01-27 Thread Jamey Cribbs
jobs.rubynow.com On Tue, Jan 26, 2010 at 5:20 PM, BCK in2is...@gmail.com wrote: We have about a dozen enhancements for a high-profile, highly- trafficked website that was written almost exclusively in Ruby on Rails. However previous project posts on guru.com and other sites have failed to

[Rails] How to retrieve the *referring* action/controller

2010-01-27 Thread Tom Ha
Hi there, I'm posting because I didn't find the answer using search engines: How do I get the name of the action and/or controller that have sent the user to the current page? (I know one can access the *current* action/controller using controller.controller_name and controller.action_name, but

[Rails] Re: dynamically set named_scope based on current_user

2010-01-27 Thread Adam Stegman
Given those relationships, you should be able to use current_user.contact.site_id. On Jan 26, 5:01 pm, JohnMerlino stoici...@aol.com wrote: Hey all, I keep getting the following error: You have a nil object when you didn't expect it! You might have expected an instance of Array. The error

[Rails] Re: Newbie question: Where do I update the CRUD statements (if they exist)?

2010-01-27 Thread Adam Stegman
Can you show us the code that is not working? Make sure you have the relationship specified in your model so Rails knows it's there. so you should have class Project ActiveRecord::Base belongs_to :user end so that you can do: Project.new :user = @user or Project.new :user_id = 12 and then

Re: [Rails] Mongrels Hanging in mysql_adapter.rb

2010-01-27 Thread serty2 serty2
For the record, our problem was sitting with the firewall between the app box and the mysql box. There seems to be a 4000 seconds timeout on any TCP connection passing through the firewall I followed the steps detailed here :

Re: [Rails] dynamically set named_scope based on current_user

2010-01-27 Thread JohnMerlino
site has many contacts through a polymorphic relationship: relationship between tables: users: contact_id contact: primary key, contactable_id, contactable_type site: primary key student: site_id User model belongs_to :contact Contact model has_one :user belongs_to :contactable,

[Rails] Exchange Server

2010-01-27 Thread eggie5
I'm looking into interacting with a Microsoft exchange server with ruby. Any pointers? It seems not promising, i can't seem to find anything good. Maybe I'm looking in the wrong places... Any pointers? -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: Failsafe errors since upgrading to 2.3

2010-01-27 Thread Pirkka Hartikainen
The problem I reported above was solved simply by updating the exceptional plugin from version 0.0.2. (!) to 2.0.7. Posting this here in case someone else has failed at keeping their gems up-to-date when upgrading to Rails 2.3. -- Posted via http://www.ruby-forum.com/. -- You received this

Re: [Rails] Invitation to connect on LinkedIn

2010-01-27 Thread Curtis Schofield
LOLCATS On Tue, Jan 26, 2010 at 8:42 PM, Krishnaprasad Varma krishnaprasadva...@gmail.com wrote: LinkedIn Krishnaprasad Varma requested to add you as a connection on LinkedIn: Mitin, I'd like to add you to my professional network on LinkedIn. - Krishnaprasad

[Rails] rails app for transfering/managing files/data

2010-01-27 Thread Christoph Jasinski
Hi, does anyone knows an application (hopefully on rails) which deals with file transfer and management. I mean in the sense of an FTP. My problems are that the client has only access to HTTP (port 80) and all the tools (like DMS, etc.) out there (like knowledgetree, etc.) are heavy (PHP) monsters

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread radu puspana
On Jan 27, 11:16 am, radu puspana radupusp...@gmail.com wrote: On Jan 26, 10:05 pm, Alpha Blue li...@ruby-forum.com wrote: I've written a complete custom built gui search engine in C++, and I'm also in the process of building a new GUI search engine for ruby.  In order to understand

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread radu puspana
On Jan 27, 11:16 am, radu puspana radupusp...@gmail.com wrote: On Jan 26, 10:05 pm, Alpha Blue li...@ruby-forum.com wrote: I've written a complete custom built gui search engine in C++, and I'm also in the process of building a new GUI search engine for ruby.  In order to understand

[Rails] Re: Time taken by page to load

2010-01-27 Thread Hemant Bhargava
Thanks guyz.. Resolved it .. Actually rails already provide this thing.. I mean using debug params, you can find out that what parameters coming.. And the based upon those parameters you can find out whatever you want.. Say like you want the action name then type just params[:action] and you'll

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread radu puspana
and do you know a link on how to buid links using raisl, like the one i need? On Jan 27, 11:31 am, Frederick Cheung frederick.che...@gmail.com wrote: On Jan 27, 9:16 am, radu puspana radupusp...@gmail.com wrote: It seems pretty simple but it's not.  You should make sure that you enforce

[Rails] Re: Re: testing errors

2010-01-27 Thread Vishwa Rao
1 class UserController ApplicationController 2 before_filter :login_required, :only= ['welcome', 'change_password', 'hidden'] 3 4 def signup 5@user = User.new(@params[:user]) 6if request.post? 7 if @user.save 8session[:user] = User.authenticate(@user.login,

RE: [Rails] state_machine prevents ActiveRecord from being persisted

2010-01-27 Thread Joel Dezenzio
What type of payment system are you using? IPN? If so, then once the payment reaches the payment gateway and the customer finishes paying, you check the status of the payment received and if successful, you change the subscription based off the amount(s) received. You are supplying information

[Rails] Re: Example or Tutorial of Rails XML

2010-01-27 Thread Marnen Laibow-Koser
Seirie wrote: If it helps any, I'm attempting to build an app that utilizes the twitter API. I know ppl have built tools for the interfacing with the twitter API specifically, but I'd rather deal with it myself using classic XML parsing. Don't reinvent the wheel. Use a Twitter library. I

[Rails] Re: I need some help

2010-01-27 Thread Marnen Laibow-Koser
kevid wrote: I can't start webrick from the command line. always have this error below. Some one help, please. C:\Users\imedia1\applicaruby script/server = Booting WEBrick = Rails 2.3.5 application starting on http://0.0.0.0:3000 = Call with -d to detach = Ctrl-C to shutdown server

[Rails] exception_notification error: custom_require.rb:31:in `gem_original_re quire': no such file to load -- action_dispatch (MissingSourceFile)

2010-01-27 Thread rtacconi
I am trying to use exception_notification but I get this error: $ script/server = Booting Mongrel = Rails 2.3.4 application starting on http://0.0.0.0:3000 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_re quire': no such file to load -- action_dispatch

[Rails] Re: Include NULL values using :group option?

2010-01-27 Thread Matt Jones
On Jan 26, 6:41 pm, Pablo Gonzalez li...@ruby-forum.com wrote: I'm trying to use the :group option in an ActiveRecord association. I wrote the code as follows: class User ActiveRecord::Base   has_many :messages, :group = thread, :order = created_at desc end It works fine as it returns

[Rails] Re: Include NULL values using :group option?

2010-01-27 Thread Pablo Gonzalez
I think you're right. I've been looking for that solution and I didn't find anything really solving it. So I guess I must figure out another approuch, perhaps giving a default value for thread. Thank you anyway. -- Posted via http://www.ruby-forum.com/. -- You received this message because

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread Alpha Blue
Test this out in IRB so you can see what happens: irb require 'cgi' puts CGI.escape( J.R.R. Tolkien ) puts CGI.escape( Jack Daniels ) You can create a simple helper file that does the formatting for you and then use a simple link_tag method to submit the link to google with the helper. If you

[Rails] Re: I need some help

2010-01-27 Thread Alpha Blue
Open a command prompt from windows and run the following command: netstat This will show you what is currently open. -- 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

RE: [Rails] Exchange Server

2010-01-27 Thread Joel Dezenzio
Telnet. http://ruby-doc.org/stdlib/libdoc/net/telnet/rdoc/index.html Sincerely, Joel Dezenzio Website Bio: http://jdezenzio.com/ Rails Production Sites: http://ncaastatpages.com -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

[Rails] Re: Redirection problem

2010-01-27 Thread CiriusMex
Still no idea? I must admit I don't have but maybe you can see something... -- 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

Re: [Rails] How to retrieve the *referring* action/controller

2010-01-27 Thread Niels Meersschaert
You can't directly find the referring action/controller, but you can get the referring URL. request.referrer The problem in trying to determine the referring action from this is you have no knowledge of the verb used on the referring URL. For example /products could be the products index

[Rails] Re: Redirection problem

2010-01-27 Thread Marnen Laibow-Koser
CiriusMex wrote: Still no idea? I must admit I don't have but maybe you can see something... It hasn't even been 24 hours since your last post. Be patient. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread radu puspana
thx again for your time JD. I did dry the code snippets you gave me, and i also searched the web for the methods of CGI, and couldn't find it anywhere, including on railsguides.com and at railsapi.com, which served me fine up till now. where should i get the fucntions for CGI? Can ri show them to

[Rails] Re: How to retrieve the *referring* action/controller

2010-01-27 Thread Tom Ha
Thanks, Niels! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: Example or Tutorial of Rails XML

2010-01-27 Thread Marnen Laibow-Koser
Seirie wrote: Hey guys. Does anyone know where I can find a good tutorial or example on how exactly to work with XML in Rails. Now, I know the different technologies you can use (REXML, Builder, etc) and I know how do use these to parse through and create documents...where I specifically have

[Rails] restful_authentication - some default tests failing

2010-01-27 Thread Max Williams
Hey all I just installed restful_authentication in a new project and have run it's specs. I'm getting a few failures. Just looking at the first, i can't understand why it's failing - can anyone see? #failing line from test route_for(:controller = 'users', :action = 'update', :id = '1').should

[Rails] Help with a bit of logic.

2010-01-27 Thread Pale Horse
I have two tables: 'owner_changes', 'tasks' 'tasks' has a primary key of 'id'. 'owner_changes' uses a 'task_id' foreign key to relate the tables. 'owner_changes' contains records for every instance of a task owner change. 'owner_changes' also houses a 'comment' column to store any comments one

[Rails] Re: Help with a bit of logic.

2010-01-27 Thread Marnen Laibow-Koser
Pale Horse wrote: I have two tables: 'owner_changes', 'tasks' 'tasks' has a primary key of 'id'. 'owner_changes' uses a 'task_id' foreign key to relate the tables. 'owner_changes' contains records for every instance of a task owner change. 'owner_changes' also houses a 'comment' column to

[Rails] Re: Help with a bit of logic.

2010-01-27 Thread Pale Horse
Marnen Laibow-Koser wrote: Use :order to put the records into the order you want. Unless you do that, the DB will return records in an unpredictable sequence. If I've not been clear enough in my description, which is likely, please specify what you'd like me to elaborate on. Best, --

Re: [Rails] Re: Re: testing errors

2010-01-27 Thread Colin Law
Could you not top post please, it is easier to follow a thread if you insert your comments inline 2010/1/27 Vishwa Rao li...@ruby-forum.com: 1 class UserController ApplicationController 2  before_filter :login_required, :only= ['welcome', 'change_password', 'hidden'] 3 4  def signup 5  

[Rails] Re: restful_authentication - some default tests failing

2010-01-27 Thread Marnen Laibow-Koser
Max Williams wrote: Hey all I just installed restful_authentication in a new project Do yourself a favor and take it right back out again. Restful_auth is based on unmaintainable, untestable generated crap code; it has no place in today's Rails ecosystem. Use Authlogic instead, which is

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread radu puspana
just tested my code in my last post and worket like a charm :) a zillion thx to JD :D So i guess i'm kinda ready for this type of event huh? :) all my best, radu On Jan 27, 6:40 pm, radu puspana radupusp...@gmail.com wrote: thx again for your time JD. I did dry the code snippets you gave me,

[Rails] Updating the Informix adapter for ActiveRecord

2010-01-27 Thread Gerardo Santana
What is the repository for the ActiveRecord adapters? I'll need to update the Informix adapter. Thanks in advance. -- 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: noob question: create a link to google a parameter

2010-01-27 Thread radu puspana
On Jan 26, 10:05 pm, Alpha Blue li...@ruby-forum.com wrote: I've written a complete custom built gui search engine in C++, and I'm also in the process of building a new GUI search engine for ruby.  In order to understand google's references, you have to look at their API.

[Rails] Re: restful_authentication - some default tests failing

2010-01-27 Thread Max Williams
Thanks Marnen, AuthLogic does look good actually. -- 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

[Rails] Re: Help with a bit of logic.

2010-01-27 Thread Marnen Laibow-Koser
Pale Horse wrote: Marnen Laibow-Koser wrote: Use :order to put the records into the order you want. Unless you do that, the DB will return records in an unpredictable sequence. If I've not been clear enough in my description, which is likely, please specify what you'd like me to

Re: [Rails] A more graceful friendly url method?

2010-01-27 Thread Philip Hallstrom
On Jan 27, 2010, at 2:39 AM, brianp wrote: Hey, I'm almost done a project and only now am I implementing friendly URLs. I'm using the method from Simply Rails 2 by Patrick Lenz. This involves the following addition to the model: def to_param #{id}-#{name}.gsub(/\W/,

Re: [Rails] Exchange Server

2010-01-27 Thread rilindo foster
What are you trying to do? Retrieve email? Or do some sort of system management? On Wed, Jan 27, 2010 at 8:31 AM, eggie5 egg...@gmail.com wrote: I'm looking into interacting with a Microsoft exchange server with ruby. Any pointers? It seems not promising, i can't seem to find anything good.

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread Alpha Blue
I was just providing an example of how queries are formed. Here's a quick and dirty test for you for the author find: def find_author(author) require 'cgi' cgi_author = CGI.escape(author) q_author = cgi_author.gsub(/\+/, '+author:') + ' ' query = http://www.google.com/groups?q=author:;

[Rails] Re: Redirection problem

2010-01-27 Thread CiriusMex
Right, sorry, I'm just going mad trying to figure this out ;) On 27 ene, 10:40, Marnen Laibow-Koser li...@ruby-forum.com wrote: CiriusMex wrote: Still no idea? I must admit I don't have but maybe you can see something... It hasn't even been 24 hours since your last post.  Be patient.

[Rails] Re: Example or Tutorial of Rails XML

2010-01-27 Thread Seirie
Excellent, all good advice, thanks guys. On Jan 27, 11:47 am, Marnen Laibow-Koser li...@ruby-forum.com wrote: Seirie wrote: Hey guys. Does anyone know where I can find a good tutorial or example on how exactly to work withXMLin Rails. Now, I know the different technologies you can use

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread radu puspana
On Jan 27, 7:46 pm, Alpha Blue li...@ruby-forum.com wrote: I was just providing an example of how queries are formed.  Here's a quick and dirty test for you for the author find: def find_author(author)   require 'cgi'   cgi_author = CGI.escape(author)   q_author = cgi_author.gsub(/\+/,

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread radu puspana
On Jan 27, 7:46 pm, Alpha Blue li...@ruby-forum.com wrote: I was just providing an example of how queries are formed.  Here's a quick and dirty test for you for the author find: def find_author(author)   require 'cgi'   cgi_author = CGI.escape(author)   q_author = cgi_author.gsub(/\+/,

[Rails] Re: Newbie question: Where do I update the CRUD statements (if they exist)?

2010-01-27 Thread pepe
I believe you will have to learn about associations (or relationships between tables, as another post has already noted). Look into 'belongs_to' and 'has_*' relationships (probably 'has_one' or 'has_many'). That will most likely teach you what you need. On Jan 26, 7:16 pm, Souschef

[Rails] Re: Re: Re: testing errors

2010-01-27 Thread Vishwa Rao
Colin Law wrote: Could you not top post please, it is easier to follow a thread if you insert your comments inline 2010/1/27 Vishwa Rao li...@ruby-forum.com: 9        flash[:message] = Signup successful 10        redirect_to :action = welcome 11      else 12        flash[:warning] =

[Rails] Re: Redirection problem

2010-01-27 Thread Marnen Laibow-Koser
CiriusMex wrote: Right, sorry, I'm just going mad trying to figure this out ;) Understood. I haven't had time to look closely at your routes, except to notice that you probably have *far* too many of them. Did you just make a controller and a map.resources line for every model whether you

[Rails] Re: Redirection problem

2010-01-27 Thread CiriusMex
Actually yes, I should clean this you're right, I'm going to check it. On 27 ene, 13:57, Marnen Laibow-Koser li...@ruby-forum.com wrote: CiriusMex wrote: Right, sorry, I'm just going mad trying to figure this out ;) Understood.  I haven't had time to look closely at your routes, except to

[Rails] Re: Redirection problem

2010-01-27 Thread pharrington
On Jan 26, 2:36 pm, CiriusMex cirius...@gmail.com wrote: Quite right.  What's the output from rake routes? Ok, it's quite big so I hope it won't be anoying, I put all of it: As a reference, the urls redirect_to :controller = 'pizarro', :action = 'logout', :id = 0 and redirect_to :controller

[Rails] Re: Redirection problem

2010-01-27 Thread pharrington
On Jan 26, 2:36 pm, CiriusMex cirius...@gmail.com wrote: Quite right.  What's the output from rake routes? Ok, it's quite big so I hope it won't be anoying, I put all of it: As a reference, the urls redirect_to :controller = 'pizarro', :action = 'logout', :id = 0 and redirect_to :controller

[Rails] Re: noob question: create a link to google a parameter

2010-01-27 Thread Alpha Blue
� q_author = cgi_author.gsub(/\+/, '+author:') + ' ' what does this line do? I know gsub will replace the +author text with something that comes out from /\+/ (althought i don't know what this regwxp could generate) gsub is used for substitution. Unlike sub which only substitutes the first

[Rails] Re: Redirection problem

2010-01-27 Thread Marnen Laibow-Koser
pharrington wrote: On Jan 26, 2:36�pm, CiriusMex cirius...@gmail.com wrote: welcome :) ROUTES BE HERE Google groups cut out my last message, so I'll repost in case any other readers were finnicky about it... Could you please reupload this to pastebin or something similar? I strongly

[Rails] Re: Redirection problem

2010-01-27 Thread CiriusMex
That being said, routes are generated/matched in the order they are defined in routes.rb. SO, when generating a route with url_for/ redirect_to/whatev :controller = 'pizarro', :action = 'logout', :id = 0, /:controller/:action gets matched before /:controller/:action/:id. (remove the

[Rails] Re: Redirection problem

2010-01-27 Thread pharrington
On Jan 27, 3:45 pm, CiriusMex cirius...@gmail.com wrote: That being said, routes are generated/matched in the order they are defined in routes.rb. SO, when generating a route with url_for/ redirect_to/whatev :controller = 'pizarro', :action = 'logout', :id = 0, /:controller/:action gets

[Rails] Re: Redirection problem

2010-01-27 Thread Marnen Laibow-Koser
CiriusMex wrote: That being said, routes are generated/matched in the order they are defined in routes.rb. SO, when generating a route with url_for/ redirect_to/whatev :controller = 'pizarro', :action = 'logout', :id = 0, /:controller/:action gets matched before /:controller/:action/:id.

[Rails] Re: Redirection problem

2010-01-27 Thread pharrington
On Jan 27, 3:45 pm, CiriusMex cirius...@gmail.com wrote: That being said, routes are generated/matched in the order they are defined in routes.rb. SO, when generating a route with url_for/ redirect_to/whatev :controller = 'pizarro', :action = 'logout', :id = 0, /:controller/:action gets

[Rails] Re: Redirection problem

2010-01-27 Thread CiriusMex
I restarted the server after doing the changes, and I have others application on the same server working correctly too...It's quite a mistery as I can't figure out what is the difference between those others applications and this one. In my local machine the rails and ruby versions are different,

[Rails] Re: Redirection problem

2010-01-27 Thread pharrington
On Jan 27, 4:00 pm, CiriusMex cirius...@gmail.com wrote: In my local machine the rails and ruby versions are different, older ones This is pretty relevant! -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send

[Rails] Re: Redirection problem

2010-01-27 Thread CiriusMex
On 27 ene, 15:04, pharrington xenogene...@gmail.com wrote: On Jan 27, 4:00 pm, CiriusMex cirius...@gmail.com wrote: In my local machine the rails and ruby versions are different, older ones This is pretty relevant! Yeah I agree but as others application on the same server are working I

[Rails] Skipping rescue handlers in dev mode

2010-01-27 Thread Tristan
Hi all To make my error pages more user-friendly I'm rendering my error messages (404, 500 etc) using the site's layout. To do this I'm using rescue_from as below: rescue_from Exception, :with = :server_error rescue_from ActionController::RoutingError, ActiveRecord::RecordNotFound, :with =

Re: [Rails] Re: Re: Re: testing errors

2010-01-27 Thread Colin Law
2010/1/27 Vishwa Rao li...@ruby-forum.com: Colin Law wrote: ... I got another error on the line assert_invalid_column_on_record user, login So I googled and found that it is deprecated and hence suggested using: assert(find_record_in_template(user).errors.invalid?(:password)) When I use

[Rails] named_scope not working

2010-01-27 Thread John Merlino
I am just trying to have the current_user only view students from his or her site. I wrestled with this many times and others say this should work but it only returns an empty set: StudentsController def index_scoper if current_user.role_id == 8 if current_user.contact and

[Rails] rails and php mixed

2010-01-27 Thread fRAnKEnSTEin
Hi, I have a rails site hosted in a mediatemple DV plan. I am not using mongrels as web server, instead i am using passenger and it works great. Now what i want to do, is to host a PHP legacy site inside my public's rails folder, so any user can acces the rails site using for example

[Rails] Better way to count Active Record Data?

2010-01-27 Thread Michael Kahle
I am trying to get hourly counts of orders between different price ranges from my database. I'm thinking there has got to be a better way than looping through each record and checking if the created_at time fits between hour 1, 2, 3, 4, etc of the day and then returning the count. Currently I am

[Rails] Re: ActiveRecord method creation issue

2010-01-27 Thread Marnen Laibow-Koser
Gal Bar-or wrote: Sorry in advance if this is on the wrong forum/topic. I'm a novice ruby developer, starting to use ActiveRecord, and am getting stuck with the following problem: I have a class defined: class User ActiveRecord::Base set_table_name users has_one :locations

[Rails] Re: rails and php mixed

2010-01-27 Thread Marnen Laibow-Koser
fRAnKEnSTEin wrote: Hi, I have a rails site hosted in a mediatemple DV plan. I am not using mongrels as web server, instead i am using passenger and it works great. Now what i want to do, is to host a PHP legacy site inside my public's rails folder, so any user can acces the rails site

[Rails] Re: Better way to count Active Record Data?

2010-01-27 Thread Marnen Laibow-Koser
Michael Kahle wrote: I am trying to get hourly counts of orders between different price ranges from my database. I'm thinking there has got to be a better way than looping through each record and checking if the created_at time fits between hour 1, 2, 3, 4, etc of the day and then returning

[Rails] Re: rails and php mixed

2010-01-27 Thread fRAnKEnSTEin
Perfect, then...you've already got your vhost.  If you really want URLs of the formwww.misite.com/phpsite, then set up a redirect. Hi, ok, but that where i have to put that redirect sentence? i mean, in .htaccess file inside public rails app, or inside php site folder, or in my www.site.com

[Rails] Re: rails and php mixed

2010-01-27 Thread Marnen Laibow-Koser
fRAnKEnSTEin wrote: Perfect, then...you've already got your vhost. �If you really want URLs of the formwww.misite.com/phpsite, then set up a redirect. Hi, ok, but that where i have to put that redirect sentence? i mean, in .htaccess file inside public rails app, or inside php site folder,

[Rails] Re: rails and php mixed

2010-01-27 Thread fRAnKEnSTEin
Perfect, then...you've already got your vhost. If you really want URLs of the form www.misite.com/phpsite, then set up a redirect. Hi, yes i need to use that URL form(www.misite.com/phpsite and ww.misite.com), but where i have put that redirect sentence? i mean, in .htaccess file inside my

[Rails] Re: Better way to count Active Record Data?

2010-01-27 Thread Michael Kahle
Marnen Laibow-Koser wrote: Michael Kahle wrote: I am trying to get hourly counts of orders between different price ranges from my database. I'm thinking there has got to be a better way than looping through each record and checking if the created_at time fits between hour 1, 2, 3, 4, etc of

[Rails] Re: Better way to count Active Record Data?

2010-01-27 Thread Marnen Laibow-Koser
Michael Kahle wrote: [...] Thanks for your reply. I use :conditions in my query to setup the @order. I was just thinking that it would be worse to do a bunch of lookups to the database for each dataset I am looking for when I could just fetch all the records I need once and then loop

[Rails] Re: named_scope not working

2010-01-27 Thread Frederick Cheung
On Jan 27, 10:31 pm, John Merlino li...@ruby-forum.com wrote: Students Model named_scope :contactable, lambda { |current_user|     case     when current_user.contact.contactable_id = 1 current_user.contact.contactable_type = 'site' then        { :conditions = {:site_id = 1}}        when

[Rails] Re: A more graceful friendly url method?

2010-01-27 Thread brianp
Hey thanks for the reply, http://github.com/rsl/stringex does look very handy I'll keep it in mind in the future. Just out of curiosity what did you mean by Might be an interesting patch since you should be able to determine what the underlying data type is and then cast it. as in maybe I should

[Rails] Super noob needs help.

2010-01-27 Thread Afg Afg
I am following video tutorials for rails. I am a part where i am suppose to write scaffold :album inside admin_controller. class AdminController ApplicationController scaffold :album end I did that but i get this errorundefined method `scaffold' for AdminController:Class What is going

Re: [Rails] Super noob needs help.

2010-01-27 Thread Conrad Taylor
On Wed, Jan 27, 2010 at 11:09 PM, Afg Afg li...@ruby-forum.com wrote: I am following video tutorials for rails. I am a part where i am suppose to write scaffold :album inside admin_controller. class AdminController ApplicationController scaffold :album end I did that but i get this

[Rails] Re: Super noob needs help.

2010-01-27 Thread Sean Six
Is the tutorial telling you to put that code in the AdminController? It is my guess that the code is based on a plugin or gem. Have you included all the proper plugins and gems? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the

[Rails] validates preference of at least one param

2010-01-27 Thread Sean Six
I have a simple RESTful search scaffold that finds data in a separate model and controller. [code] h1New search/h1 % form_for(@search) do |f| % %= f.error_messages % p %= f.label :category_id %br / %= f.collection_select :category_id, Category.all, :id, :name, :include_blank = true

  1   2   >