Giter Site home page Giter Site logo

booksandauthorswithtypeahead2's Introduction

Example app for Hot Glue 0.6.0 Here's how this app was built:

bin/rails generate model Author first_name:string last_name:string
bin/rails generate model Book author_id:integer title:string

next, install the global typeahead tools bin/rails generate hot_glue:typeahead_install

next, generate a scaffold for the authors bin/rails generate hot_glue:scaffold Author --gd --smart-layout

next, generate a scaffold for the books and modify the author_id into a type ahead: bin/rails generate hot_glue:scaffold Book --modify='author_id{typeahead}' --gd --smart-layout

Notice this gives us an important warning message:

WARNING: you specified --modify=author_id{typeahead} but there is no file at `app/controllers/authors_typeahead_controller.rb`

It instructs us to do this:

bin/rails generate hot_glue:typeahead Author

As well as the above, I created methods name on both Book and Author, and added to the config/routes.rb file

Setup

You do not do the steps above, they are just written out to demonstrate what I did to build the app.

After you db:create & db:migrate, you should seed this database using the data migrator:

bin/rails data:migrate this will create 100 random author names and 1000 random books.

Node + Ruby versions are in .node-version and .ruby-version, respectively.

bin/setup

Start Rails

bin/dev

Run Specs

run with bin/rake

booksandauthorswithtypeahead2's People

Contributors

jasonfb avatar

Watchers

 avatar

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.