Coder Social home page Coder Social logo

railschef's Introduction

Railschef

A collection of useful Rails generator scripts.

Setup

Rails 3

Add the gem to your Gemfile.

gem "railschef", :group => :development

Then you can run any of the included generators.

rails g railschef:auth User UserSession

Supported environment

  • Rails 3.1.x

  • Authlogic

Included Generators

  • railschef:layout: generates generic layout, stylesheet, and helper files.

  • railschef:auth: generates user model with sign up and log in.

To view the README for each generator, run it with the help option.

rails g railschef:layout --help

Troubleshooting and FAQs

I get “undefined method ‘title’” error.

Try running railschef:layout, that will generate this helper method. Or you can just change the templates to whatever approach you prefer for setting the title.

I can’t set new attributes in my model.

Add the attribute to the attr_accessible line in the model.

I get “undefined method ‘root_url’” error.

Some generators default redirecting to the root_url. Set this in your routes.rb file like this (substituting your controller name).

root :to => "home#index"

and make sure you have create a replacement for home when you use ‘–skip-home’ option.

I get a missing database error.

Run rake db:migrate.

I get a routing error when I try to submit a form.

Try restarting your development server. Sometimes it doesn’t detect the change in the routing.

Found a bug?

Development

railschef's People

Contributors

hariodanarto85 avatar agustinus-ap avatar

Watchers

 avatar James Cloos 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.