Displaying 20 results from an estimated 3000 matches similar to: "scaffolding generators and pluralization rules"
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 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
2005 Dec 28
5
simple scaffold question
How do I get scaffold to generate code for a table whos name is not plural
of the modelname I give to it. I.E., If I have an existing database, and
wish to generate scaffold code for existing tables, is this possible???
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
2006 Jan 12
8
Scaffolding support for many-to-many editing (habtm)?
Like with simple table editing, there are also typical ways of how a
user usually interacts with one-to-many or many-to-many relations. For
example, one would show the fields of one row of table1 in the screen
and below a line-by-line view of all associated entries in table2. Then,
one could press an "Edit" button and add or delete rows from table2 to
this entry of table1,
2005 Aug 08
7
Problems with ./scripts/generate scaffold
Hi all,
I''m new to rails after having used perl for most of these things, and am
trying to get my head around the generate script for a project playing
around
with.
If I do:
./scripts/generate controller Device
I get app/controllers/device_controller.rb
where I can then add:
scaffold :device
However, if I want to actually generate the scaffolding so I can make
some changes:
2005 Mar 18
0
scaffold generator, pluralization and tutorials
Hi
All the tutorials call their controllers ''TodoController''[1] or
''RecipeController''[2] (singular),
but "script/generate scaffold Recipe" for example generates
a ''RecipesController'' (in recipes_controller.rb)
As I''m rather new to RoR I don''t know if that convention changed,
I read something about it here:
2006 Apr 16
5
Newbie Problems with pluralization
Hi,
I have a many to many relationship incorporating the following tables:
taxes --> taxes_tax_groups --> tax_groups
I have a model named tax with the following declaration:
has_and_belongs_to_many :tax_groups
and I have a model named tax_group with the following declaration:
has_and_belongs_to_many :taxes
I am attempting to run the following unit test:
require
2006 Mar 03
3
Pluralisation issue?
I''m having trouble with rails and a table named ''dives''. It seems to
work fine if I try it with another table name. I''ve generated the
scaffold with the script and have not made any modifications to it. When
I try to run the dives controller it starts looking for ''dife.rb'' and
fives me ''uninitialized constant Dife''.
Is this a
2015 Apr 16
4
ClamAV reports a trojan
On Thu, April 16, 2015 10:09 am, Les Mikesell wrote:
> On Thu, Apr 16, 2015 at 10:01 AM, James B. Byrne <byrnejb at harte-lyne.ca>
wrote:
>> This morning I discovered this in my clamav report from one of our imap
servers:
>> /usr/share/nmap/scripts/irc-unrealircd-backdoor.nse:
>> Unix.Trojan.MSShellcode-21 FOUND
>> I have looked at this script and it appears to be
2006 Mar 29
11
why belongs_to does not like validation?
This works :
class Recipe < ActiveRecord::Base
belongs_to :category
end
But (when I add validation) this does not work :
class Recipe < ActiveRecord::Base
belongs_to :category
validates_length_of :category, :within => 6..20
validates_uniqueness_of :category, :message => "already exists"
end
thank you
--
View this message in context:
2006 Apr 11
4
cookbook2
I am a new user to RoR/ I have been working on RoR cookbook2 tutorial
which could be found at
http://instantrails.rubyforge.org/tutorial/index.html. As I have been
going through different stages through trial and error, but now a stage
has come that i m stuck and not able to proceed any further. when it
comes to create a list.rhtml in recipe folder under views, and editing
the code which is
2006 Nov 17
8
Basic search, quick question
Hi, I know there are other threads about this topic, but I''ve checked
and none seem to help my problem.
I''m trying to get a simple search to work on my Rails app, but I get a
"Couldn''t find Recipe without an ID" error when I search. Here''s what I
have:
list.rhtml
<%= start_form_tag :action => ''find_recipes'' %>
2006 May 16
3
wondering how to do some clever DRYing up
Hi there,
I''m now getting to the point in my rails app where I can use all of the nice basic features like AJAX and engines etc...
but, I want to get my hands a bit dirtier, whilst learning to DRY up my code a bit.
I''m using AJAX quite a bit to dynamically populate/edit/sort has_many relationships in forms, and consequently on a model with many has_many''s I end up
2006 Jan 08
4
Rails table pluralizing Issue
Hi,
I am working on a table with name "addresses". However when I do a
ruby script/generate scaffold Address, I am not able to access
http://localhost:3000/addresses. I am getting the following error.
uninitialized constant Addres
This error occured while loading the following files:
addres.rb
How do I resolve this issue.
Thanks
Silvy MAthews
2006 Feb 28
10
Scaffold command, how and what may be wrong?
hi everyone. I am learning RoR and just recently purchase the agile wed
dev on rails. i am still at the beginning of the book trying to create
the scaffold for the depot_development database. Everytime i run the
generate scaffold products admin, i recieve the "before building the
scaffold, try to create a table for model products" etc...
a few questions:
1. How does ruby know that
2012 Jul 19
20
Rails' inflections are messy
Yesterday, I opened a GitHub Issue<https://github.com/rails/rails/pull/7071> about
moving Rails inflections to an initializer. The idea wasn''t received well,
understandably, as generating a large initializer with new Rails apps is
pretty unappealing. However, the core members seemed open to the discussion
of alternatives continuing here.
For those of you not in the know,
2006 Apr 05
13
scaffold misuse?
Running ruby script/generate scaffold Product Admin
is a wonderful way to set up well, exactly what it says, a scaffold.
My problem is that I have several other tables that are linked,
through foreign keys, to the Product table. Say an "authors" table.
Now when I go enter a new product, a book, I want the application to
provide a drop down list of authors generated from the records in
2006 Feb 03
3
My associations are coming out nil.
I''ve got a fairly simple system with a table for my Users that
includes a CountryId field which looks up to the CountryId field of my
Country table. What I would like to happen is for my Rails
application, which contains models for both User and Country, to be
able to draw the dropdown list of available countries on the edit
page, like it does in all the tutorials.
My model classes look
2006 Nov 03
10
[PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator
========================
By Pat Maddox
Use this generator to generate RESTful scaffolding with RSpec specifications.
Syntax is exactly the same as the scaffold_resource generator:
./script/generate rspec_resource ModelName [field:type field:type]
When you run this generator, it will create a migration, model, and
model spec file. In addition, it gives you a RESTful
2006 Feb 03
0
Re: the dreaded error Before updating scaffolding from new D
Hi Derek,
I was getting this too, with three tables, called taxa,
databases and references
I found I could add an irregular pluralisation for taxa:
Inflector.inflections do |inflect|
inflect.irregular ''taxon'', ''taxa''
end
to the environment.rb, but no amount of modification there would
allow databases and