Using button_to with a get request

I am trying to use a button_to with a get request instead of the default post. The docs seem to say this is possible but I can not get it to work.

This is what I have tried: <%= button_to "Create New Page" , {:controller => 'page', :action => 'create_page'}, {:method => 'get'}%>

But this still does a post - the html output: <form method="post" action="/page/create_page" class="button- to"><div><input method="get" type="submit" value="Create New Page" /></

</form>

Help please.

I am trying to use a button_to with a get request instead of the default post. The docs seem to say this is possible but I can not get it to work.

This is what I have tried: <%= button_to "Create New Page" , {:controller => 'page', :action => 'create_page'}, {:method => 'get'}%>

But this still does a post - the html output: <form method="post" action="/page/create_page" class="button- to"><div><input method="get" type="submit" value="Create New Page" /></ ></form>

Help please.

You'll have to do something else... the source reads below... and one line 123 you can see that method=post is hardcoded. In fact, where you've got your :method => 'get' it's going to show up *inside* the <input> button (as you can see above).

      # File vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb, line 110 110: def button_to(name, options = {}, html_options = nil) 111: html_options = (html_options || {}).stringify_keys 112: convert_boolean_attributes!(html_options, %w( disabled )) 113: 114: if confirm = html_options.delete("confirm") 115: html_options["onclick"] = "return                           #{confirm_javascript_function(confirm)};" 116: end 117: 118: url = options.is_a?(String) ? options : url_for(options) 119: name ||= url 120: 121: html_options.merge!("type" => "submit", "value" => name) 122: 123: "<form method=\"post\" action=\"#{h url}\"                          class=\"button-to\"><div>" + 124: tag("input", html_options) + "</div></form>" 125: end

Are you happy with your dedicated server, your ISP, and the distro you use? Everyone else who needs to be using a dedicated server would like to know -- I'm not kidding. Since the only dependable recipe for picking a dedicated server ISP is to hear of the successful experiences of other Rails developers, I suggest the following:

If you'll email the following info (or more) directly to me:

ISP URL: Distro you're using: # of dedicated servers you have: If more than one server, cluster architecture: Comments:

...I will assemble the responses (keeping sources anonymous) and post that result back to the list.

Thank you!

Don

PS: I'm aware this topic makes periodic appearances in this list. But in scanning the past six months of messages containing the word "dedicated" I found only one clearly enthusiastic recommendation: rimuhosting.com. Surely as a collective community we have a lot more information than this. Perhaps since I am willing to collate, anonymize and repost, enough of y'all will email me so that we will all have a valuable shortlist of potential candidates. Thanks again!

I’ve very happy with eApps.

Did you check out http://railshostinginfo.com/ ? I think it's kinda new but there might be some stuff you can use there.

This would probably be more applicable/informative/useful on the rails-deploy list as well.

J.

Jordan,

I appreciate your response, as I did not know, or had forgotten, that the rails-deploy list existed. Yes, that would surely be a better forum, and I will repost there.

Thank you,

Don

[mailto:rubyonrails-talk@googlegroups.com] On Behalf Of Jordan Krushen

Jordan,

I appreciate your response, as I did not know, or had forgotten, that the

rails-deploy list existed. Yes, that would surely be a better forum, and I will repost there.

Hi Don!

I have a Lunarpages (shared though) and they’re good. They also provide VPS and dedicated. Maybe you want to check them out.

A nicer alternative (IMHO) to dedicated is slice-based hosting. Which is maybe like scalable VPS. EngineYard seems to be a very good choice if you’re looking for quality (quite costly). There is also SliceHost, which is cheaper but they’ll help you manage your VPS.

Check out my page at http://web2withrubyonrails.gauldong.net/rails-hosting/ for more ideas.

The general site http://hosting-reviews.com may also give you some more added thoughts. :slight_smile:

Hope this helps. :slight_smile:

Thank you,

Don

From: rubyonrails-talk@googlegroups.com [mailto: rubyonrails-talk@googlegroups.com] On Behalf Of Jordan Krushen Sent: Tuesday, February 06, 2007 1:23 PM To: rubyonrails-talk@googlegroups.com Subject: [Rails] Re: Survey to find dedicated server ISPs that Rails

developers are happy with

Are you happy with your dedicated server, your ISP, and the distro you use? Everyone else who needs to be using a dedicated server would like to

know – I’m not kidding. Since the only dependable recipe for picking a dedicated server ISP is to hear of the successful experiences of other Rails developers, I suggest the following:

…I will assemble the responses (keeping sources anonymous) and post that result back to the list.

Did you check out http://railshostinginfo.com/ ? I think it’s kinda new but there might be some stuff you can use there.

This would probably be more applicable/informative/useful on the rails-deploy list as well.

J.

LinkedIn: http://www.linkedin.com/in/ceefour

Don Sawtelle wrote:

Are you happy with your dedicated server, your ISP, and the distro you use? Everyone else who needs to be using a dedicated server would like to know -- I'm not kidding. Since the only dependable recipe for picking a dedicated server ISP is to hear of the successful experiences of other Rails developers, I suggest the following:

If you'll email the following info (or more) directly to me:

ISP URL:

All of our dedicated machines have been customized per customer. You can use the contact page form to inquire.

Distro you're using:

CentOS, Fedora, and Debian

Many of our development customers become managed co-location customers.

Cheers,

Robby

> I appreciate your response, as I did not know, or had forgotten, that the > rails-deploy list existed. Yes, that would surely be a better forum, and I > will repost there.

snip...

A nicer alternative (IMHO) to dedicated is slice-based hosting. Which is maybe like scalable VPS. EngineYard seems to be a very good choice if you're looking for quality (quite costly).

Thank you for the kind words, Hendy.

Our customers actually consider us rather inexpensive as the level of service and expertise we bring literally saves them an operations team in many cases. How much is *that* worth?

We just survived our first Digging today. Our good customer change.org rose to the home page, and boy, did the traffic follow! We're happy to have a Digging under our belts. We've also survived a couple of TechCrunchings, for kongregate.com, gubb.net and change.org as well.

Has anyone had any experience with ServerPronto? They're the only dedicated option within my conceivable price range, but the low price makes me think of ill of the quality of service.

--Jeremy

Thanks Jeremy I've downloaded your book (EXCELLENT) and I've put serverpronto at http://web2withrubyonrails.gauldong.net/rails-hosting/ . I mentioned your name because I know ServerPronto from you so let me know if you mind me doing that.

Thanks again :slight_smile:

Don,

I have a 512MB slice on slicehost.com and am very happy with their service. The server works well, is very responsive, and has been very reliable.

I use Gentoo 64bit Linux and have been very happy with it. I can customize and tune exactly what is installed and keeping things up to date with security fixes is very easy with the Gentoo portage system. Another nice thing about Gentoo is that nearly anything you would want to install is already to go and just a simple emerge away. This has proven to be much easier than any other distro I have used, plus I can compile anything with exactly the features I want.

I haven’t yet needed an additional server but I know where I will go to get one :slight_smile:

The staff at slicehost.com is very knowledgable and ready to help. I would definitely recommend slicehost.com.

Jeff Barczewski

Thanks Jeremy I've downloaded your book (EXCELLENT) and I've put serverpronto at http://web2withrubyonrails.gauldong.net/rails-hosting/

OK, cool! They look decent, and I've only found one little pocket of bad reviews from them. If I end up going with them, I'll let you know how my experience goes!

. I mentioned your name because I know ServerPronto from you so let me know if you mind me doing that.

Thanks again :slight_smile:

No way! That's perfectly fine.

Thanks for building that list; there were a few that I hadn't heard of and can now suggest.

--Jeremy

+1 for slicehost.com.

Vish