So I've got a signup form and part of it is billing/credit card info. That info is all stored and processed by a third party app and so the data isn't stored in our database.
So how can I still run the items through the validates_ methods in Rails? (validates_presence_of, validates_length_of, etc etc)
Or am I going about validation in ...
So In my rails app I have two resources (rentals, and reservations) which belong to a user. This is the code in my routes.rb to set up the nested routes.
map.resources :users, :has_many => :reservations, :shallow => true
map.resources :users, :has_many => :rentals, :shallow => true
map.resources :rentals, :only => [:index]
map....
We are using gravtars for a site currently being developed in rails 2.3.4 and i am finding that the rails side tends to cache the images even after there is a change at the gravtar side. I know with javascript you can prevent caching when using thejavacript_include_tag :cache => false method, however, is there a way to prevent the cache...
Today we had a lot more activity than normal between our Rails app and our remote legacy MS-SQL Server 2005 database, and we started getting the error below intermittently. Any ideas what it is + how to prevent (besides avoiding the situation, which we're working on :)
Error Message:
ActiveRecord::StatementInvalid: DBI::DatabaseError: ...
We've deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web servers. Each web server also runs nginx with a cluster of mongrels. The nginx here takes care of static content and load balancing the mo...
What does this part . . .
unless Rakismet::Base.rakismet_binding.nil?
{ :referrer => 'request.referer', :user_ip => 'request.remote_ip',
:user_agent => 'request.user_agent' }.each_pair do |k,v|
data[k] = eval(v, Rakismet::Base.rakismet_binding) || ''
end
end
of the following method do?
module In...
I have 6 years of C# programming experience and I'm looking to broaden my horizons. I'm going to build a simple web app to demonstrate knowledge of Ruby on Rails so I can get my foot in a place that might want a Rails programmer. It's the hot new thing, so I want to be marketable.
Anyway, I have been playing around with solr and tomcat ...
While I have experience developing Rails apps in English, I am a blank slate when it comes to handling globalization, so please don't shoot me in the head if my question 'doesn't make sense' :)
I have been asked to add multi language feature to a part of a Rails app that I am working on. Initially its only going to be 2 languages, Fren...
I am a beginner in using Rails and Git
I have InstantRails installed and created an app by:
$ rails myapp
It created all the necessary files.
I went to the directory,
$ cd myapp
then I tried initializing git
$ git init
but it said : 'git' is not recognized as an internal or external command,
operable program or batch file.
So I fi...
Hello,
I want to make sure I have the right meta desc/keyword and title text in my view so I want to create rspec views tests for that. Now the real challange here is how to make it work across multiple languages.
The way I've done it is:
it "should have the right page title" do
title = "some nice title here"
response.should have_...
collection_select and select Rails helpers: Which one should I use?
I can't see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a scenario where collection_select is better than select? or is anything I am missing here?
...
Very soon I plan on deploying my first Ruby on Rails application to a production environment and I've even picked a webhost with all the managed server and Capistrano goodness you'd expect from a RoR provider.
The provider allows for Mongrel, Thin, Passenger & FastCGI web servers, which seems very flexible, but I honestly don't know the...
Can anyone please provide me in layman's terms the difference between developing a JRuby and a Ruby, Rails application?
I use NetBeans as my Ruby on Rails IDE and every-time I create a project is asks me that question - and I don't really get the difference. Are there any pro and cons?
...
Let's say I have a model foo, and my model has a publish! method that changes a few properties on that model and potentially a few others too.
Now, the Rails way suggests that I expose my model over rest and let the end user monkey with parameters.
What should I do if I want to expose my publish! method instead to protect my model? Is...
How can I encode a string (iso to utf-8 for example) in Ruby on Rails, using Ruby 1.8.7 ?
...
I want to use some Scriptaculous effects on error messages.
<% form_for(@page) do |f| %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.error_message_on "name" %>
<%= f.label :content %>
<%= f.text_field :content %>
<%= f.error_message_on "content" %>
<%= f.submit 'Create' %>
<% end %>
My first ide...
I have a form on another website (using a different backend) that I want to be able to POST to my Rails application (on a different domain).
How do I generate a valid authenticity token for the external form so that my Rails app will accept it?
Assuming I can do the answer to the above question--is there anything else special I need to...
I have add stylesheet link tag to my application. I'm sure its worked. because in another place is working. but if I run at my computer it did not working. I mean my application cant load css
when I seen at view source the result is :
<script src="http://localhost:3000//javascripts/application.js?1258048544" type="text/javascript"></sc...
I'm trying to access a date variable from a form individually to the other variables. The form is a formtastic plugin form. The issue I am facing is that the date is a three-part dropdown and simply doing params[:friend][:born_on] doesn't seem to be doing the trick as it returns NULL.
Here is my parameters output;
Parameters: {"comm...
I have an apache server running, with mongrels underneath running rails. The apache config file for my rails app looks like this:
<VirtualHost *:80>
ServerName trunk.production.charanga
ServerAlias max.trunk.production.charanga
DocumentRoot /home/max/work/e_learning_resource/trunk/public
RewriteEngine On
<Proxy balancer://...