Displaying 20 results from an estimated 5000 matches similar to: "Can a route require POST or GET? / REST problem with routing"
2006 Aug 10
2
Software caused connection abort
Hi Zed or anyone that is also looking at Mongrel,
Just want to report something that, although doesn''t crash mongrel, is
rather annoying.
I am running the latest Mongrel 0.3.13.3 - ruby version on cygwin
(yeah, poor me). When I start mongrel_rails with
ActiveRecord::Base.allow_concurrency = true in environment.rb, I see a
lot of
"Error sending file
2006 Jul 10
2
cross controller functional tests?
Hi,
I have an online store and I would like to simulate a complete
shopping trip which involves several controllers? How can I write a
test that calls actions from different controllers in a particular
sequence? Something like the following which involves department,
product, cart_item, and cart controllers.
get department 5
check it has a link to product 4
get product 4
post cartitem/create
get
2005 Dec 21
8
Incomplete headers
Hi,
I wanna use Rails on a SuSE server with apache. Everything should be
installed correctly, but when running the application I get this in my
apache log:
FastCGI: comm with server
"/srv/www/htdocs/web4/html/rails/public/dispatch.fcgi" aborted: idle
timeout (60 sec)
FastCGI: incomplete headers (0 bytes) received from server
2006 Jan 19
7
validates_numericality_of positive integer
Hi,
What is the simplest way to validate a positive integer?
validates_numericality_of :foo, :integer_only => true
how do I add the positive part? Do I need another validation statement
for pattern matching or do I have to write a validate() funciton for
my model?
Thanks,
Peter
2006 Jul 15
4
routing requirements broken in Rails 1.1.4?
Hi,
I have the following routes
map.connect '':controller/:id/:action'', :id=>/4/, :defaults=>{ :action=>''show''}
map.connect '':controller/:action'', :defaults=>{:action=>''index''}
and when I point my browser to "localhost:3000/departments" I see an
error because the show action cannot find a
2006 Apr 26
10
save new model with child model
Hi,
I am having a problem saving a new model that has an associated child
model. If a new ticket is being created and will have one comment to
go with it then I tried this in my action
@ticket = Ticket.new(params[:ticket])
@comment = Comment.new(params[:comment])
@ticket.comments << @comment
if @ticket.save
@notice = "Ticket added. Thanks for
2006 Mar 22
14
currency conversion webservice in a rails app?
Hi,
I''m interested in using a currency conversion web service in my rails
app. Does anyone have a free service that they use and like? I found
this one
http://www.webservicex.net/WS/WSDetails.aspx?CATID=2&WSID=10
I''ve tried to make a simple, plain Ruby script to connect to this and
get a conversion rate without success.
How do I integrate a webservice into my rails app? I
2006 Jul 24
1
Newbie error: undefined local variable or method
When I add an item to the shopping cart, I get an error:
undefined local variable or method `cart_item'' for
#<#<Class:0x3715a78>:0x3715a48>
Session info says the cart being updated properly. I''m just not able
to output two variables:
<%= cart_item.quantity %> × <%= h(cart_item.title) %>
I did some research, and I can grasp that local
2006 Apr 01
4
problems getting ActionMailer working (on server)
Hi,
I''ve read the Agile Rails book''s chapter on ActionMailer a few times.
Seems pretty straight forward. Unfortunately I can''t get my
application to actually send mail.
I uploaded my application to the web server and tried to get a mail
message sent. Nothing happened. I looked in the log file and it says
Sent mail:
From: service@freedomkilts.com
To:
2006 Jan 26
8
switching to edge rails
Hi,
I want to start using has_many :through. I think that eventually I''ll
be removing all uses has_and_belongs_to_many from my project.
Here is my situation
I''m using SVN
I want to use edge rails
Reading the wiki about switching to edge rails[1], I can''t figure out
which combination of subsections I must perform.
Do I want edge rails to reside in the vendor
2006 Apr 26
3
catch all error for incorrect urls etc
Hi,
I am changing a very standard old school website to rails. When I make
the change to rails, all of the old urls will not be valid. If a
person has a bookmark to an old web page I would like them to be
directed to the front page of the new website www.domain.com. How do I
do this? Do I do something in routes.rb?
Thanks,
Peter
2006 Feb 09
2
_marker in dragdrop.js
Hi,
I''ve been confused about the purpose of _marker in dragdrop.js for
quite a while. It doesn''t really look like it does anything with
ghosting on or off. I removed the mark method and didn''t discover any
problems. Is all the mark business a relic from some past idea?
Thanks,
Peter
2006 Jan 23
4
an image that is a clickable link?
Hi,
How do I make an image that is a clickable link the rails way? Is
there a view helper for this?
Thanks,
Peter
2006 Mar 08
12
favorite FTP client of railers
Hi,
Which FTP client would fit in nicely with OS X and Textmate.
Thanks,
Peter
2006 May 27
5
ActiveSupport JSON working?
Hi,
I am trying to convert a hash to JSON using ActiveSupports built in
.to_json. I am doing similar to the example below but are there
certain strings that could go in place of ''bar'' or ''rez'' that will
break the to_json method? I am using a very long string from rjs
output in place of ''bar''.
Perhaps .to_json is not ready yet?
Thanks,
Peter
2006 Jul 21
10
why validation on server side
hi,
i have noticed that the validations in RoR happen at server side
mostly what sites do is using javascript they validate user information
there...
whats the point of doing it at the server side
is it that loading of javascript file in a browser makes a response to
client slow
and validation at server side offsets that....?????
any sugeestions????
is it that i am missing something as
2006 Mar 16
4
calling an actionview method from inside a model
Hi,
I would like my model instance to produce it''s own list of options for
a form select. This is from a product model that has_many variations
def alts_for_select(current_id)
the_map = variations.map{|v| [v.name, v.id]}
options_for_select(the_map, current_id)
end
the model cannot see the options_for_select method
I tried to use
2006 Jan 15
2
scaffold suddenly pluralizing names
I haven''t updated rails today and all of a sudden scaffold is
pluralizing my names
ruby script/generate scaffold Admin::Category
produces
class Admin::CategoriesController < ApplicationController
Do I really want "CategoriesController" instead of "CategoryController"?
Thanks,
Peter
2006 Jan 15
4
model helper location
Hi,
I''m looking at the rails cookbook for uploading files[1]. At the
bottom of the page it says that the sanitize_filename functioin would
probably go in a helper or a library. I wonder where these files would
be or what they would be called. Pehaps there are some conventions I
need to know about?
Thanks,
Peter
[1] http://manuals.rubyonrails.com/read/chapter/78
2006 Jul 03
2
rjs renders string or partial but not template or action
Hi,
I have an rjs file. I only have one controller called called front. I
have views called "new_title.rhtml" and "_new_title.rhtml"
These work
page.replace_html ''title'', ''new title''
page.replace_html ''title'', :partial => ''new_title''
page.replace_html ''title'',