Coder Social home page Coder Social logo

view_mapper's Issues

view_mapper breaks script/generate on rails 2.3.14 with bundler

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

error Class 'office' does not exist or contains a syntax error and could not be loaded.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.