Giter VIP home page Giter VIP logo

frontend-generators's Introduction

FrontendGenerators

This gem can be used to easily set up a Start Bootstrap theme in your Rails application. The Start Bootstrap code has fully been modified to follow Rails conventions (Rails partials are awesome!).

The FrontendGenerators gem also lets you easily copy the Bootstrap & Font Awesome css, js, and fonts directly into your application. Most people use twitter-bootstrap-rails and font-awesome-rails to access these frontend libraries in their code, but I find it much easier to just have the code in my own applications. It's easier to examine the source code when it's in your application and you can avoid frusterating Rails asset pipeline bugs with this straightforward setup. Annoying bugs are what motivated me to create this gem in the first place.

This video shows how to use the gem.

Installation

Add this line to your application's Gemfile:

gem 'frontend-generators'

And then execute:

$ bundle

Update your Rakefile with this code:

require "frontend_generators"
load 'tasks/add_assets.rake'

Bootstrap

To move the Bootstrap files into your Rails application, run this rake task:

bundle exec rake add_assets:bootstrap

Go to application.css and add this line:

*= require bootstrap

Go to application.js and add this line:

//= require bootstrap

The fonts are in the /public/fonts/ directory because Rails keeps changing where the fonts should be and it is annoying to keep up with all the changes.

Font-Awesome

To move the Font-Awesome files into your Rails application, run this rake task:

bundle exec rake add_assets:font_awesome

Go to application.css and add this line:

*= require font_awesome

To move the Start Bootstrap Stylish Portfolio theme into your Rails application, run this rake task:

bundle exec rake add_assets:stylish_portfolio

Add the route to routes.rb:

get 'stylish_portfolios/index'

Add this line to config/initializers/assets.rb:

Rails.application.config.assets.precompile += %w( stylish_portfolio/manifest.css stylish_portfolio/manifest.js )

To move the Start Bootstrap Creative theme into your Rails application, run this rake task:

bundle exec rake add_assets:creative

Add the route to routes.rb:

get 'creatives/index'

Add this line to config/initializers/assets.rb:

Rails.application.config.assets.precompile += %w( creative/manifest.js creative/manifest.css )

To move the Start Bootstrap Freelancer theme into your Rails application, run this rake task:

bundle exec rake add_assets:freelancer

Add the route to routes.rb:

get 'freelancers/index'

Add this line to config/initializers/assets.rb:

Rails.application.config.assets.precompile += %w( freelancer/manifest.js freelancer/manifest.css )

To move the Start Bootstrap Clean Blog theme into your Rails application, run this rake task:

bundle exec rake add_assets:clean_blog

Add the routes to routes.rb:

root 'clean_blogs#index'
get  'about' 	=> 'clean_blogs#about'
get  'post' 	=> 'clean_blogs#post'
get  'contact' 	=> 'clean_blogs#contact'

Remove this line from app/assets/stylsheets/application.css:

*= require bootstrap

To move the Start Bootstrap Grayscale theme into your Rails application, run this rake task:

bundle exec rake add_assets:grayscale

Add the route to routes.rb:

get 'grayscales/index'

Add this line to config/initializers/assets.rb:

Rails.application.config.assets.precompile += %w( grayscale/manifest.js grayscale/manifest.css )

To move the Start Bootstrap New Age theme into your Rails application, run this rake task:

bundle exec rake add_assets:new_age

Add the route to routes.rb:

get 'new_ages/index'

Add this line to config/initializers/assets.rb:

Rails.application.config.assets.precompile += %w( new_age/manifest.js new_age/manifest.css )

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/MrPowers/frontend-generators.

License

The gem is available as open source under the terms of the MIT License.

frontend-generators's People

Contributors

mrpowers avatar rhuberdeau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frontend-generators's Issues

Rails 5 support?

The command "bundle exec rake add_assets:bootstrap" fails with Rails 5.0.1:

Corea:grayscale_codecraft carycampbell$ bundle exec rake add_assets:bootstrap
rake aborted!
Don't know how to build task 'add_assets:bootstrap' (see --tasks)
/Users/carycampbell/.gem/ruby/2.3.1/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/cli/exec.rb:74:in `load'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/cli/exec.rb:27:in `run'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/cli.rb:332:in `exec'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/cli.rb:20:in `dispatch'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/cli.rb:11:in `start'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/exe/bundle:34:in `block in <top (required)>'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/Users/carycampbell/.gem/ruby/2.3.1/gems/bundler-1.13.1/exe/bundle:26:in `<top (required)>'
/Users/carycampbell/.gem/ruby/2.3.1/bin/bundle:23:in `load'
/Users/carycampbell/.gem/ruby/2.3.1/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

Is your gem supposed to support the Rails 5.0.1 version?

Thanks in advance for your help!

SB-Admin-2 Rake was aborted

bundle exec rake add_assets:sb-admin-2
rake aborted!
Don't know how to build task 'add_assets:sb-admin-2' (see --tasks)
/usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in eval' /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in

'
(See full trace by running task with --trace)

Freelancer Theme

After I implemented freelancer theme, everything worked fine except scrollspy effect. I've tried creative theme, scrollspy worked. I'm not sure where went wrong.

ActionController::UnknownFormat in NewAgesController#index

New Age Theme is not working. I got the following error:

NewAgesController#index is missing a template for this request format and variant. request.formats: ["text/html"] request.variant: [] NOTE! For XHR/Ajax or API requests, this action would normally respond with 204 No Content: an empty white screen. Since you're loading it in a web browser, we assume that you expected to actually render a template, not nothing, so we're showing an error to be extra-clear. If you expect 204 No Content, carry on. That's what you'll get from an XHR or API request. Give it a shot.

Grayscale and Stylish_portfolio Themes was aborted

Hey Guys, firts I want to thank's for this incredible gem, this help a lot!
The stylish_portfolio and creative Themes works perfectly in my app.
But when I try to use the cleand Blog or Grayscale Themes. Wasn't possible to run the
bundle exec rake add_assets:grayscale.
It was aborted. My logs:

bundle exec rake add_assets:grayscale
rake aborted!
Don't know how to build task 'add_assets:grayscale'

(See full trace by running task with --trace)
bundle exec rake add_assets:clean_blog
rake aborted!
Don't know how to build task 'add_assets:clean_blog'

(See full trace by running task with --trace)

add to README

root path from plural to singular
new_ages/index to this new_age/index

Rails 5.1 needs jquery-rails gem

Styles are not importing correctly

Using "*= require bootstrap" in application.css as described in the README does not allow the specific styles associated with each theme to over write the default bootstrap styles.

To replicate, create a new rails app, install the frontend-generators gem, follow the install instructions, install the clean-blog theme. Load up a page and compare it to the live preview version. Notice some of the text styling is missing.

To fix this, we need to move to import rather than require. For example, we just need to create main.scss in the same folder as application.scss and add @import "bootstrap";

Creative Theme

Sorry i am pretty new to rail.

I've followed the instructions in the read.md but the creatives theme is installed but not displayed.

If you can give me some hints. Thanks

that's my system:

Rails version 4.2.5
Ruby version 2.2.3-p173 (x86_64-darwin15)
RubyGems version 2.4.5.1
Rack version 1.6.4
JavaScript Runtime JavaScriptCore
Middleware
Rack::Sendfile
ActionDispatch::Static
Rack::Lock

ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007fa48a415088

Rack::Runtime
Rack::MethodOverride
ActionDispatch::RequestId
RequestStore::Middleware
Rails::Rack::Logger
ActionDispatch::ShowExceptions
WebConsole::Middleware
ActionDispatch::DebugExceptions
ActionDispatch::RemoteIp
ActionDispatch::Reloader
ActionDispatch::Callbacks
ActiveRecord::Migration::CheckPending
ActiveRecord::ConnectionAdapters::ConnectionManagement
ActiveRecord::QueryCache
ActionDispatch::Cookies
ActionDispatch::Session::CookieStore
ActionDispatch::Flash
ActionDispatch::ParamsParser
Rack::Head
Rack::ConditionalGet
Rack::ETag

Adding to a gemfile installs gem version 0.0.1

When I add a gem to the Gemfile it installs v 0.0.1 of a gem for some reason. So I had to specify path to github repo. That fixed an issue.

Using frontend-generators 0.3.0 (was 0.0.1) from https://github.com/MrPowers/frontend-generators.git (at master@7593173)

But you probably may want to update a gem version at rubygems.org ?

For the rest of stuff - thank you very much. The gem saves a ton of time

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.