similar to: script/generate scaffold pluralizes class names

Displaying 20 results from an estimated 2000 matches similar to: "script/generate scaffold pluralizes class names"

2006 Oct 17
3
rake -T is missing rake db:fixtures:dump?
Subject says it all: rake doesn''t know about db:fixtures:dump. When I try, I get this: Don''t know how to build task ''db:fixtures:dump'' I thought this was a standard feature that ships with rake- any idea why it''s missing, and how I can reinstall it? Here''s the environment: Ruby version 1.8.4 (powerpc-darwin8.6.0) RubyGems
2007 Jul 18
16
Edge Rails namespaced routing
Hi, I was wondering if anyone came across a similar scenario when working with namespaced routes with edge rails. Consider an application with controllers customers and products that also have other resources. map.resources :customers do |customer| customer.resources :notes customer.resources :tags end map.resources :products do |product| customer.resources :notes customer.resources
2006 Mar 17
1
edge - scaffolds now pluralized?
Are my eyes going buggy, or did something recently change in Edge Rails so that now scaffolds are generated with pluralized controller/ helper/etc names? I peeked at the code in railties/lib/rails_generator/generators/components/scaffold/ scaffold_generator.rb around line 50, and it looks like there was a change there recently so that it now defaults to pluralized names. So why was this
2006 Jun 24
2
error log for views?
This may be a bonehead question, but when I have some error in a view I''m testing, the server spits out a generic page: "Application error Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html" This is pretty unhelpful when I''m debugging. Is there an error log for Rails overall
2005 Aug 08
68
Pluralized Controller Names?
If I do: script/generate controller Photo I get a controller named photo_controller. OTOH, if I do: script/generate scaffold Photo I get a controller named photos_controller. (Note that the controller name is pluralized). I realize that I''m specifying the controller name explicitly in the first case, but it seems odd to me that the scaffold command generates a pluralized
2006 Jun 10
6
table associations
First, thanks to everyone who replied to my pluralization question from before! Today I was trying to do what I think is called a "chained accessor". I have an "events" table and each event has one user. Instead of seeing the id number for each event''s user, I''d rather display the names of users instead. I tried to do this: class Event <
2006 Sep 24
8
form_for and Multiple Models Being Saved
Howdy Folks, I want to use form_for to allow a user to submit a form that contains two instances of the same model. They are entering calendar dates and I want them to be able to submit 2 from the same form. Ok, so, using form_for, what is the best way to do this? form_for seems to be setup to handle a single instance in that it wants a name for the variable, etc... Has someone else done this?
2006 Jul 08
1
conditional table association?
I''m using a db to log two types of events, link events and tag events. At first I had two tables, link_events & tag_events, but this seemed not very DRY because the only column that was different between them was link_id and tag_id respectively. So I made these tables: events: id int user_id int objtype_id int (holds ''1'' or ''2'' depending
2006 Aug 15
6
try creating a table for your model
Railers: Greetings from the low end of the learning curve. I have installed all the prerequisites on Win32, including a lite MySQL database with a table in it called Inventory. Then I run this command line... ruby script/generate ajax_scaffold Inventory ...and I get this error message: error Before updating scaffolding from new DB schema, try creating a table for your model
2007 Jan 02
2
link_to method throws a url_for error
This error seems pretty bizarre. I''m using ActionMailer and am using a template in app/views/welcome_mailer/join.rhtml which has this line: <%= link_to :controller => ''group'', :action => ''join'', :group => @group.id, :ic => @code.code %> The error is: undefined method `url_for'' for #<WelcomeMailer: 0x2aaaad4fb470>
2006 Aug 16
2
About scaffold mean
Hello All! I''m novice at ROR. Would you like to explain what mean such constuction in Ruby. 1: class DemoController < ActionController::Base 2: scaffold :item 3: end Is 2th line calling of method ''scaffold''? If it is so, when it called? For all instances of class, or only for class? I watch sources of ActionController, but don''t understand completely.
2006 Jun 22
1
acts_as_taggable gem problems
With acts_as_taggable 1.04... 1. how can I get a frequency of tags? i.e. /tags/list I want to list of tags sorted and listed with their frequency tags_controller.rb: def list @tags = Tags.find_by_sql ''select name, count(*) as freq from tags group by name order by freq desc'' End tags/list.rb: <ul> <% @tags.each do |t| %> <li><%= t.freq %>
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 Jul 18
2
Scaffold a Plural table w/ No Pluralization in environment
Hi guys, I have a situation here. I have my project set to no pluralization due to legacy tables in environment.rb. Now, I have some new tables which I''m starting to pluralize. When I do a generate a scaffold to this new table: script/generate scaffold my_tables table it seems to work out fine for certain sections like http://mysite.com/railsapp/new (which also inserts properly to
2006 Mar 05
4
Help implementing a 43things-like ''activity'' measurement
I''m trying to implement something in my app akin to 43things'' main page, where more active topics are bigger than the less active topics. The difference in my app is that I''m building a business-oriented app and want to have a list of clients, where clients with recent activity are larger than others. My perhaps too-clever way of going about this is by feeding each job
2008 Feb 21
1
Creating incorrect plurals when generating scaffold
Preface: I''m trying to find my way through the "Build Your Own Ruby on Rails Web Application" book. I''m completely new to programming and am having a hard time figuring out the differences between rails 2.0.2 and what''s in the book so please forgive me if this is a stupid question. I''m confused because I finally thought I''d figured out the
2006 Jun 28
2
hash value won''t increment with =+ operator
I have a database of bookmarks and tags, and want to count the number of bookmarks each tag is assigned to, for example: user "tyler" has the tag "concerts" on 15 out of his 30 bookmarks. This code: hash = Hash.new("0"); @user.tags.each do |t| @user.bookmarks.each do |b| x = 0 if b.tags.include?(t) then hash[b.id] =+ 1 puts "hash is #{hash}
2006 Jun 30
0
find_by_sql not quoting properly (in acts_as_taggable plugin)
I have run into a very strange problem discovered through the use of the acts_as_taggable plugin, but related to quoting/sanitizing the interpolated list in a find_by_sql. Apologies for the length, but I wanted to be complete. ;-) The method from acts_as_taggable.rb is: def find_tagged_with(list) find_by_sql(["SELECT #{table_name}.* FROM #{table_name}, tags,
2006 Jun 21
3
rake migrate says table already exists
Hi all, I used the generate script to make a bunch of table migrations, resulting in files like 002_bookmarks.rb, 003_tags.rb, etc. When I did the ''rake migrate'', the db was set up but more migration files appeared, now called 009_create_bookmarks.rb, 010_create_tags.rb, etc. Now when I want to change the database (add a table or column, alter the schema) I do
2006 Apr 28
1
acts_as_taggable help
Ahoy, having a bit of difficulty w/ the acts as taggable GEM. I was able to create a tagcloud, but now i want to filter items by tags. in my controller i have def show_tagged_with <-- snip snip --> @items = Item.find_tagged_with( :any => params[:tag_name]) @categories = Category.find_all @tag_name = params[:tag_name] @tagged_items = Item.tags_count(:limit