Skip to content

Instantly share code, notes, and snippets.

@poustovitss
Created March 28, 2018 08:45
Show Gist options
  • Select an option

  • Save poustovitss/53456250c8ef8c8c2a5666749a7d482b to your computer and use it in GitHub Desktop.

Select an option

Save poustovitss/53456250c8ef8c8c2a5666749a7d482b to your computer and use it in GitHub Desktop.
How to create default CBRA (component based rails application)
rails new app
cd app
rm -r app
mkdir components
rails plugin new components/app_component --full --mountable
cd components/app_component
rails g controller welcome index
fix app.component.gemspec
nano /components/app_component/config/routes.rb
add there: «root to: "welcome#index»
go to the top app and add component to GEMFILE:
« gem "app_component", path: "components/app_component»
got to the top app and add component to routes.rb:
«mount AppComponent::Engine, at: "/»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment