patshaughnessy / view_mapper Goto Github PK
View Code? Open in Web Editor NEWScaffolding for your models and plugins
Home Page: http://patshaughnessy.net/view_mapper
License: MIT License
Scaffolding for your models and plugins
Home Page: http://patshaughnessy.net/view_mapper
License: MIT License
http://patshaughnessy.net/2010/2/13/creating-associations-to-existing-data-part-2-belongs_to-with-auto_complete
.
.
once I got to here..
cuzican@CUZIVISTA ~/gitrepo/test
$ script/generate scaffold_for_view employee name:string --view belongs_to_auto_complete:office
warning Model Office does not contain a has_many association for Employee.
cuzican@CUZIVISTA ~/gitrepo/test
$ vi app/models/office.rb
i then added the has_many association.. then i got the below
cuzican@CUZIVISTA ~/gitrepo/test
$ script/generate scaffold_for_view employee name:string --view belongs_to_auto_complete:office
error Class 'office' does not exist or contains a syntax error and could not be loaded.
I tried changing office to Office and then spent all kinds of time trying different variations of the has_many.. plural.. not.. looking at my rails env.. etc.. and I wasted a bit of time because I was too stupid to notice that I was adding the has_many as follows:
has_many employees
when i should have added it as "has_many :employees" .. damn colon..
added that colon and all was well.. since you do such a good job checking for things I figured I should let u know this one so you could add a check in it and save others headaches.. or not.. ;->
p.s. nice work.
Will be a nice option :)
See this thread: rubygems/bundler#210 (comment)
I know this is all old and all, but I still have it around.. I'd be willing to help try to fix it if I had some guidance or todos from ya..
I would get this: Couldn't find 'scaffold_for_view' generator
So I tried adding view_mapper to Gemfile and bundle update but then that broke the general script/generate command.. So I left it out of the Gemfile but then it doesn't work when using bundler.
http://gembundler.com/rails23.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.