I have this syntax which works (since it's from the API, pretty much)
<% form_tag :action => "whatever" do -%>
<div><%= submit_tag 'Save' %></div>
<% end -%>
and this, which works
<%= form_tag({:action => "whatever"}, {:method => "get"})%>
Now I have tried to combine them, guessing the syntax. The "get" does not get added ...
Is there any way to upload files from a flex app to a rails 2.2 backend when using the default Cookie Session Store?
...
I've got apache2.2 on windows. I'm trying to serve both subversion (/svn) and redmine (/redmine). I have svn running fine with this config:
<Location /svn>
DAV svn
SVNParentPath C:/svn_repository
...
</Location>
This is working great--my svn users can hit http://mybox/svn just fine.
Now I want to add another directory for a rai...
I'm terrible at naming and realize that there are a better set of names for my models in my Rails app. Is there a way to use a migration to rename a model and its table?
...
When I try to call a stored procedure from Rails, I get this exception:
ActiveRecord::StatementInvalid: Mysql::Error: PROCEDURE pipeline-ws_development.match_save_all can't return a result set in the given context: call match_save_all()
from /Users/otto/Projects/Futures/src/pipeline-ws/vendor/rails/activerecord/lib/active_record/con...
(this question was originally posted in another forum a few months ago, without getting any answer ... there was no SO at these times!)
My first steps in RoR. I baught one of these books talking about Ruby, and Ruby On Rails. Examples are running correctly on MySQL, so I decided to rewrite them for MS-SQL as a good exercice (and as MS...
I'm creating a Ruby on Rails app that consists of stories. Each story has multiple pages.
How can I set up routes.rb so that I can have URLs like this:
http://mysite.com/[story id]/[page id]
Like:
http://mysite.com/29/46
Currently I'm using this sort of setup:
http://mysite.com/stories/29/pages/46
Using:
ActionController::Rout...
I've done scaffolding using the method described here http://wiki.rubyonrails.org/rails/pages/ScaffoldGenerator
However, I want to know what do i do if i want to add more fields AFTER I have ran the ./script/generate scaffolding model> propertyname:string
...
We are prepping for the release of a large web application that has been in development for the past year. We are about to start the process of integrating ActiveMerchant to handle recurring subscription fees for the service.
I am looking for any advice regarding best practices considering our requirements (listed below) and any additio...
How do I change a rails app so that a controller foo appears as the application root?
In other words, right now all the urls look like host.com/foo/... and I'd like to get rid of the foo and have simply host.com/...
...
I am working on the billing component of a Ruby on Rails application using ActiveMerchant. The payment gateway we have chosen is PaymentExpress.
Code examples I am seeing such as the one below, use authorize() and void() to test the validity of a card:
def test_card!
auth_response = gateway.authorize(100, card)
gateway.void(auth_re...
I have an app where I want to link an instance of a model to another instance of the same model via another model (i.e. Task1 > Relationship < Task2) and am wondering if I can use has_many :through for this.
Basically, the relationship model would have extra information (type_of_relationship, lag) so it would be ideal to have it as a jo...
I have been using Netbeans 6.5 recently - it complains (on startup, and if I try to run a unit test):
"Rails requires RubyGems >= 1.3.1 (you have 1.0.1). Please gem update --system and try again."
Yet from the command line "gem --version" : 1.3.1
any ideas? why does netbeans not realise I have gems 1.3.1 ?
...
How do you create and send emails from Rails application, that contain images and proper formatting? like the ones you get from facebook and like.
...
I've got some logic in a controller that sets a status of an object if certain conditions are met:
if params[:concept][:consulted_legal] == 0 && params[:concept][:consulted_marketing] == 1
@concept.attributes = {:status => 'Awaiting Compliance Approval'}
elsif params[:concept][:consulted_marketing] == 0 && params[:concept][:consulted_...
I have two controllers for two respective models, by example, photos and categories. index and show methods are very similar in each controller, and the views are identical. What is the best method for share the view by the two models?
I've though two options:
Use a helper. In the helper will put the code for the view, and will call t...
I asked a question earlier which elicited some great responses.
Here's the earlier question
On the back of some advice given there, I've tried moving the following controller logic
if params[:concept][:consulted_legal] == 0 && params[:concept][:consulted_marketing] == 1
@concept.attributes = {:status => 'Awaiting Compliance Approva...
Hi,
I am trying to use oauth with the rares-branch Ruby gem. I keep getting the error:
instance of OAuth::Consumer needs to have method `marshal_load'
My code, activate.rb is below. Any thoughts on how to fix this? THANKS! -Henry
require 'oauth/consumer'
def index
@consumer = OAuth::Consumer.new("CONSUMER KEY","CONSUMER SECRET", ...
So I just started my first rails project yesterday. I had two many-to-many (has_and_belongs_to_many) relationships in my application. I had one between models games and teams and another between models stats and results. This was all working just fine by creating the join table myself with a migration.
I then decided that I did not w...
Is there a way to limit the amount of memory Phusion Passenger uses when serving up your app?
My host comes by and kills the process after I get a bunch of traffic and so I end up serving up blank pages. Is there anything I can do to say "hey don't use any more than 100Mb and only spawn 3 processes no matter how overloaded the site is"...