search for: richardonrail

Displaying 13 results from an estimated 13 matches for "richardonrail".

Did you mean: richardonrails
2010 Mar 22
7
How to reference a select_tag within a form
Hi All, Inside my app\views\expenses\new.html.erb file, I had the code: <% form_for(@expense) do |f| %> [snip] <p> <%= f.label :vendor %><br /> <%= f.text_field :vendor %> <br /> <div id="vendor_droplist> <%= select_tag "test", options_for_select(@current_vendors.collect { |v| v.nickname }), {:multiple
2010 Jul 06
4
Simple routing problem
I''ve got the following in config\routes.rb: map.resources :users In app\views\shared\_menu.erb, I''ve got: Please sign in <%= link_to "here", :controller=>"user", :action=>"sign_in" -%> In app\controllers\users_controller.rb def sign_in end When I run the application, I crash with: Routing Error No route matches
2010 Apr 14
35
Conditionally adding a link to a form -- how?
I''ve got two entities created by scaffolding: Expense & Vendor In Expense#new there''s a form with a Vendors-drop-down and a NewVendor- button. The latter button brings up Vendor#new. The Create button in Vendor#new brings up Vendor#show with Edit & Back links. I want to append a third link conditionally to Vendor#show: if the Expense#new form led to the Vendor#show
2010 Mar 20
4
Displaying an image in a Rails form_for
Hi, I''ve got a public\images\DownArrow.jpg and app\views\expenses\new.html.erb that want to present this image in the following context: <p> <%= f.label :vendor %><br /> <%= f.text_field :vendor %> <%= f.image "DownArrow.jpg" %> <br> <%= select_tag "test", options_for_select(@current_vendors.collect {
2008 Nov 21
15
Switching the version of Rails that an app uses
Hi All, I’ve got a few versions or Rails installed and I''d like to run an App I’m developing with various versions of Rails. I heard of two ways to switch the version of Rails that an app uses: 1. Use GitHub as described by http://kylecordes.com/2008/04/30/git-windows-go/ . But that requires using Bash in a Command Window and more steps than I want to go through. 2. Alter
2010 Jul 16
31
Added associations but don't see generated methods
Hi, I''ve got a Rails app working that includes two two classes, etc.: Expense & Vendor. I eventually learned that the mental concept I had of their relationship should be express in Rails as: class Expense < ActiveRecord::Base; belongs_to :vendor; end class Vendor < ActiveRecord::Base; has_many :expenses; end
2008 Aug 22
2
How to find/open Spec::Expectations and Spec::Matchers
Hi, Then RSpec 1.4 recommends, in the webpage http://rspec.info/documentation/expectations.html, referencing the subject items. I''m running ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] over WinXP-Pro/SP2. I believe I installed RSpec with a Ruby gem. At least, I think that''s confirmed because I have a lot of stuff in the directory K:\_Utilities
2010 Mar 10
2
Decimal fields generated in Rails 2.3.5 act like strings, sort of
Hi All, I just created a new CRUD "expense" (using Rails 2.3.5 scaffold) which included "amount:decimal". When I: 1. populated the amount field of a new expense with 5 characters: 12.50 and 2. saved the new record I got a display of the new record that showed Amount to be merely "12". I clicked Update and put my cursor over the data field for Amount and got a
2010 Apr 03
2
Specifying a decimal field precision/scale with scaffold requires 2 steps?
Hi, It appears to me that the command: ruby script/generate scaffold whatever money_field:decimal(10,2) will not generate a valid migration. Therefore it appears to me only two ways to achieve the desired result is: 1.1 Omit the the precision/scale on the scaffold command 1.2 Edit the migration file by following the "do |t| ... end" with the command: change_column :whatever
2008 Dec 20
4
Accessing rails helpers when processing erb snippets
I need to be able to merge a lot of content for web pages, along with links to other pages taken from a list of categories. The text that goes with each category can be different depending on the context that it''s displayed in. I could do this by having a whole stack of *.html.erb files which hold the static content and access the Rails helpers to pull in stuff from the database and
2010 Mar 12
7
"We're sorry, but something went wrong." from RoR app
Hi All, "We''re sorry, but something went wrong." is the message I got when I started up an RoR app in the environment: Rails 2.3.5 Ruby 1.8.6 WinXP-Pro/SP3 Firefox 3.6 MySQL 5.0.37-community-nt Mongrel The app under development was working fine until I (stupidly) thought I needed to upgrade MySQL to 5.1.44. I took the precaution of MySQL-dumping the development db before
2010 Feb 23
0
rake db:create:wants LibMySQL.dll for MySQL 5.0.37; where?
Hi All, I''m running: WinXP-Pro/SP3 Rails 2.3.5 MySQL 5.0.37-community-nt I ran rake db:create:all and got something like: LibMySQL.dll required. I had a worse symptom previously when, on an earlier post on a related failure, Sharagoz kindly suggested I drop back to a 5.0 version of MySQL. As I prepared this post, I wanted to recall my version. In particular, I wanted to run select *
2010 Feb 23
2
Problem: The command "rake db:create:all" crashes
Hi All, I''m running: Rails 2.3.5 MySQL 5.1.44 WindowsXP-Pro/SP3 Following Noel Rappin''s book, Pro RoR, I successfully got past the point of creating my first scaffold: ruby script/generate scaffold supplier nickname:string qbname:string That produced the migration, 20100221011210_create_suppliers.rb: class CreateSuppliers < ActiveRecord::Migration def self.up