Coder Social home page Coder Social logo

rails-bootstrap's Introduction

Rails Bootstrap Rails and Bootstrap

Rails 5.1 example application that integrates Rails and Bootstrap 4.0.

Bootstrap (formerly Twitter Bootstrap) provides CSS stylesheets and JavaScript code for the visual design of websites. Bootstrap is a framework for client-side (browser-based or “front end”) development, much like Ruby on Rails is a framework for server-side development.

Use this example application as a starter app for your own web applications.

You can build this application in only a few minutes using the Rails Composer tool.

Quickstart Guide

The RailsApps project provides a Rails and Bootstrap Quickstart Guide with details about integrating Rails and Bootstrap.

Join RailsApps

From the RailsApps Project

The RailsApps open source project offers starter applications and tutorials for Rails developers. Generate the applications with the Rails Composer tool.

All the code is explained in the Capstone Rails Tutorials. You can purchase the Capstone Rails Tutorials to support the project.

If You Are New to Rails

If you’re new to Rails, see What is Ruby on Rails?, the book Learn Ruby on Rails, and recommendations for a Rails tutorial.

What Is Implemented — and What Is Not

The example application can be used as the basis for any website. It shows the simplest approach to implementing a website, using practices recommended by experienced Rails developers. With knowledge of Rails, the website can be adapted and customized to your needs. Features include:

  • Home page
  • “About” page
  • Navigation bar
  • Flash messages

Additional Pages

The application uses the high_voltage gem for the “About” page. Additional pages can easily be added. The high_voltage gem makes it easy to add pages with static content (text that doesn’t change) incorporating elements of a site-wide application layout such as header, navigation links, and footer.

For example, using the high_voltage gem, you could add pages for:

  • FAQ
  • News
  • Legal disclaimers

Database

The application does not require a database. No pages are generated using information from a database and no user-submitted data is saved to a database. However, the sqlite3 gem is included in the Gemfile so Rails ActiveRecord can be used to add database functionality to the web application.

Similar Examples and Tutorials

This is one in a series of Rails example apps and tutorials from the RailsApps Project. See a list of additional Rails examples, tutorials, and starter apps. Related example applications may be useful:

Accounts You Will Need

We provide instructions to deploy the tutorial application to Heroku which provides Rails application hosting. It costs nothing to set up a Heroku account and deploy as many applications as you want. To deploy an app to Heroku, you must have a Heroku account. Visit Heroku to set up an account.

Dependencies

Before generating your application, you will need:

  • The Ruby language – version 2.4.1
  • The Rails gem – version 5.1

See the article Installing Rails for instructions about setting up Rails and your development environment.

Getting the Application

Local

You have several options for getting the code on your own machine. You can fork, clone, or generate.

Fork

If you’d like to add features (or bug fixes) to improve the example application, you can fork the GitHub repo and make pull requests. Your code contributions are welcome!

Clone

If you want to copy and customize the app with changes that are only useful for your own project, you can clone the GitHub repo. You’ll need to search-and-replace the project name throughout the application. You probably should generate the app instead (see below). To clone:

$ git clone git://github.com/RailsApps/rails-bootstrap.git

You’ll need git on your machine. See Rails and Git.

Generate

If you want to use the project as a starter application, use the Rails Composer tool to generate a new version of the example app. You’ll be able to give it your own project name when you generate the app. Generating the application gives you additional options.

To build the example application, Rails 5.1 must be installed in your development environment. Run the command:

$ rails new rails-bootstrap -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb

The $ character indicates a shell prompt; don’t include it when you run the command.

This creates a new Rails app named rails-bootstrap on your computer. You can use a different name if you wish.

You’ll see a prompt:

option  Build a starter application?
    1)  Build a RailsApps example application
    2)  Contributed applications
    3)  Custom application

Enter “1” to select Build a RailsApps example application. You’ll see a prompt:

option  Choose a starter application.
    1)  learn-rails
    2)  rails-bootstrap
    3)  rails-foundation
    4)  rails-mailinglist-activejob
    5)  rails-omniauth
    6)  rails-devise
    7)  rails-devise-roles
    8)  rails-devise-pundit
    9)  rails-signup-download
   10)  rails-stripe-checkout

Choose rails-bootstrap. The Rails Composer tool may give you other options (other applications may have been added since these notes were written).

Web Servers

If you plan to deploy to Heroku, select Unicorn as your production webserver.

Template Engine

The example application uses the default “ERB” Rails template engine. Optionally, you can use another template engine, such as Haml or Slim. See instructions for Haml and Rails.

Testing

If you are a beginner, select “None.”

Other Choices

Set a robots.txt file to ban spiders if you want to keep your new site out of Google search results.

If you choose to create a GitHub repository, the generator will prompt you for a GitHub username and password.

It is a good idea to use RVM, the Ruby Version Manager, and create a project-specific rvm gemset (not available on Windows). See Installing Rails.

Troubleshooting

If you get an error “OpenSSL certificate verify failed” or “Gem::RemoteFetcher::FetchError: SSL_connect” see the article OpenSSL errors and Rails.

Edit the README

If you’re storing the app in a GitHub repository, please edit the README files to add a description of the app and your contact info. If you don’t change the README, people will think I am the author of your version of the application.

Getting Started

See the article Installing Rails to make sure your development environment is prepared properly.

Use RVM

I recommend using rvm, the Ruby Version Manager, to create a project-specific gemset for the application. If you generate the application with the Rails Composer tool, you can create a project-specific gemset.

Gems

Here are the gems used by the application:

These gems make development easier:

Install the Required Gems

If you used the Rails Composer tool to generate the example app, the application template script has already run the bundle install command.

If not, you should run the bundle install command to install the required gems on your computer:

$ bundle install

You can check which gems are installed on your computer with:

$ gem list

Keep in mind that you have installed these gems locally. When you deploy the app to another server, the same gems (and versions) must be available.

Configuration File

To consolidate configuration settings in a single location, store credentials in the config/secrets.yml file. To keep your credentials private, use Unix environment variables to set your credentials. See the article Rails Environment Variables for more information.

This is the default config/secrets.yml file:

development:
  secret_key_base: (not shown)

The example application does not require any configuration settings. The file config/secrets.yml is provided in case you need to customize the application with features that require configuration settings.

If you don’t want to use Unix environment variables, you can set each value directly in the config/secrets.yml file. The file must be in your git repository when you deploy to Heroku. However, you shouldn’t save the file to a public GitHub repository where other people can see your credentials.

Change your Application’s Secret Token

If you’ve used the Rails Composer tool to generate the application, the application’s secret token will be unique, just as with any Rails application generated with the rails new command.

However, if you’ve cloned the application directly from GitHub, it is crucial that you change the application’s secret token before deploying your application in production mode. Otherwise, people could change their session information, and potentially access your site without permission. Your secret token should be at least 30 characters long and completely random.

Get a unique secret token:

rake secret

Edit the config/secrets.yml file to change the secret token.

Test the App

You can check that your application runs properly by entering the command:

$ rails server

To see your application in action, open a browser window and navigate to http://localhost:3000/.

You should see a home page with a placeholder headline.

You should be able to click the navigation link for “About” and see a placeholder page.

Stop the server with Control-C. If you test the app by starting the web server and then leave the server running while you install new gems, you’ll have to restart the server to see any changes. The same is true for changes to configuration files in the config folder. This can be confusing to new Rails developers because you can change files in the app folders without restarting the server. Stop the server each time after testing and you will avoid this issue.

Deploy to Heroku

Heroku provides low cost, easily configured Rails application hosting.

From the Command Line

You can deploy from the command line.

$ git push origin master

If you’ve set configuration values in the config/secrets.yml file, you’ll need to set them as Heroku environment variables. You can set Heroku environment variables directly with heroku config:add. For example:

$ heroku config:add GMAIL_USERNAME='[email protected]' GMAIL_PASSWORD='secret'

Complete Heroku deployment with:

$ git push heroku master

See the Tutorial for Rails on Heroku for details.

Troubleshooting

Problems? Check the issues.

Documentation

The Tutorial provides additional documentation.

Issues

Please create a GitHub issue if you identify any problems or have suggestions for improvements.

Where to Get Help

Your best source for help with problems is Stack Overflow. Your issue may have been encountered and addressed by others.

You can also try Rails Hotline, a free telephone hotline for Rails help staffed by volunteers.

Contributing

If you make improvements to this application, please share with others.

Send the author a message, create an issue, or fork the project and submit a pull request.

If you add functionality to this application, create an alternative implementation, or build an application that is similar, please contact me and I’ll add a note to the README so that others can find your work.

Credits

Daniel Kehoe implemented the application and wrote the tutorial.

Is the app useful to you? Follow the project on Twitter: @rails_apps
and tweet some praise. I’d love to know you were helped out by what I’ve put together.

MIT License

MIT License

Copyright ©2013-16 Daniel Kehoe

Useful Links

Getting Started Articles Tutorials
Ruby on Rails Analytics for Rails Rails Bootstrap
What is Ruby on Rails? Heroku and Rails Rails Foundation
Learn Ruby on Rails JavaScript and Rails RSpec Tutorial
Rails Tutorial Rails Environment Variables Rails Devise Tutorial
Ruby on Rails Tutorial for Beginners Git and GitHub with Rails Devise RSpec
Install Ruby on Rails Send Email with Rails Devise Bootstrap
Install Ruby on Rails – Mac OS X Haml and Rails Rails Membership Site with Stripe
Install Ruby on Rails – Ubuntu Rails Application Layout Rails Subscription Site with Recurly
Ruby on Rails – Nitrous.io HTML5 Boilerplate for Rails Startup Prelaunch Signup Application
Update Rails Example Gemfiles for Rails
Rails Composer Rails Application Templates
Rails Examples Rails Product Planning
Rails Starter Apps Rails Project Management

rails-bootstrap's People

Contributors

danielkehoe avatar djs070 avatar glebm 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  avatar  avatar  avatar  avatar

Watchers

 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

rails-bootstrap's Issues

[Rails 4.1] Sprockets error shows undeclared dependency

When using Bootstrap with Rails 4.1.0, when visiting any page of the rails-bootstrap example app, I get this error:

Sprockets::Rails::Helper::DependencyError at /
Asset depends on 'bootstrap/glyphicons-halflings-regular.eot' to generate properly but has not declared the dependency
Please add: `//= depend_on_asset "bootstrap/glyphicons-halflings-regular.eot"` to '/Users/danielkehoe/workspace/wip/rails-devise-pundit/app/assets/stylesheets/framework_and_overrides.css.scss'

This is because sanity checks from the sprockets_better_errors gem have been merged into Rails 4.1. The intent is to reveal asset pipeline errors that you would see in production when you run the app in development mode. See rails/sprockets-rails#96

To resolve this, the rails_layout gem should update the framework_and_overrides.css.scss file to include:

//= depend_on_asset "bootstrap/glyphicons-halflings-regular.eot"

Foundation 4 and Simple Forms

Reading other issues about SF and Bootstrap 3, I wonder if currently there are any issues selecting Foundation 4 and Simple Forms on app creation process?

Unable to dismiss Modal windows when vistors.error object has errors in it.

PROBLEM: When the modal window is initially displayed, the user is asked to select a favorite and enter a comment. If the user enters nothing in and clicks the Choose button, an error message appears, as it should. However, at this point, the user cannot dismiss the modal window by clicking the Close button or the X. The modal window stays regardless.

I think this is because of <div id="modal-form" class="modal" style="display: <%= @visitor.errors.any? ? 'block' : 'none';%>">. At this point the visitor.errors object still evaluates to true and show the div style is set to as a block instead of none.

I think that the div style should be reset to none when the user clicks the x or the close button and the visitor.errors object cleared.

This doesn't seem to generate any views for any options

I've ran this generator a number of times with various options, and it doesn't seem to generate any views. I've left one of the repositories on my page - the 'academicessays' repo. I don't really know why this is happening, but bundler is failing to install 'nio4r' gem at first attempt. Anyone have any ideas?

SimpleForm blocking update to Bootstrap 3 for rails-bootstrap example

The rails-bootstrap example application currently uses Bootstrap 2.3. I'd like to update from Bootstrap 2.3 to Bootstrap 3.0. The accompanying tutorial shows how to use the SimpleForm gem with Rails. SimpleForm integrates nicely with Bootstrap 2.3 for attractive form styling. Unfortunately, SimpleForm does not yet support Bootstrap 3.0. Until SimpleForm issue heartcombo/simple_form#864 is resolved, we must continue to use Bootstrap 2.3.

Help me with deploying to Heroku

I get the error of the gem sqlite3 no longer compatible with heroku could I get the full code to get this issue resolved because when I take sqlite out nothing looks right

Remove precompiled assets from public/assets

When generating a new app with this template, I got many problems with JavaScript and styling because of these precompiled assets. It took me a while to find out that these assets exists at all.

I think it would be fine to remove these assets when composing a new app.

undefined local variable or method `has_no_table' (when following tutorial)

I'm in the final of the Chapter Survey Form and I have this message:
NameError at /
undefined local variable or method `has_no_tab' for Visitor(Table doesn't exist):Class

method_missingactiverecord (4.1.0.rc1) lib/active_record/dynamic_matchers.rb

  if match && match.valid?
    match.define
    send(name, *arguments, &block)
  else
    super
  end
end
class Method
  @matchers = []

Tip: add gem "binding_of_caller" to your Gemfile to enable the REPL and local/instance variable inspection.

Request info

Request parameters
{"controller"=>"visitors", "action"=>"new"}
Rack session

<ActionDispatch::Request::Session:0x7fec0fdba2b0 not yet loaded>

I don't know why don't works in my gem file I have the: gem 'activerecord-tableless', in the notice tip shows add a gem "bindbing_of-caller". Do this?

My Gemfile is:

source 'https://rubygems.org'
ruby '2.1.1'
gem 'rails', '4.1.0.rc1'
gem 'sqlite3'
gem 'sass-rails', '> 4.0.1'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '
> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '> 2.0'
gem 'sdoc', '
> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'activerecord-tableless'
gem 'bootstrap-sass'
gem 'google_drive'
gem 'high_voltage'
gem 'simple_form'
group :development do
gem 'better_errors'
gem 'binding_of_caller', :platforms=>[:mri_19, :mri_20, :rbx]
gem 'quiet_assets'
gem 'rails_layout'
end

Assets Not Working On Heroku

I think this is a pretty basic problem but I can't seem to fix it. My images and css are not working on production.

Just says: Failed to load resource

Can you help?

Error : Your Ruby version is 2.2.2, but your Gemfile specified 2.2.3

Sorry, I think I post it in a wrong place.
I closed it already.


Hello,

I am new into programming.
2 hours ago, I could operate the website offline (via localhost) but after folowing a tutorial for deploying the site with heroku, now I cannot run bundle install and the site that I see online is not my website that I have finished.lol.
it shows this error
image

I used ruby 2.2.3 and the gemfile also show the same version.
image

I think I messed my website's files, didn't I?!
could someone help me?

also I would like to ask whether I can use this tutorial to deploy my finished website using heroku?
In which step can I "upload" my apps' files?
https://devcenter.heroku.com/articles/getting-started-with-rails4#local-workstation-setup

If I cannot use that tutorial, would somebody be so kind to give me links for the tutorial I need?

Ruby version is 2.2.2, but your Gemfile specified 2.2.3

The file .ruby-version specifies Ruby version 2.2.2, but the Gemfile specifies 2.2.3. Thus when I 'cd' into the directory and try 'bundle install', I get the error 'Your Ruby version is 2.2.2, but your Gemfile specified 2.2.3'.

Suggestion to add bootswatch styles

Thanks for this project, I love how easy it was to deploy.

One of my concerns with bootstrap-saas is how inflexible it is. Yes, we can override styles in the bootstrap_and_overrides.css.scss file. The issue is that this file could become very messy if the project were being scaled and required a lot of customizations. A necessary evil? Perhaps...

My suggestion would be to offer a pre-built-in setup option to import styles from http://bootswatch.com/

This is just a thought for a future version, or if someone wants to fork it.

You should move to a newer version of Capistrano

Hi,

The version of capistrano specified is near 3. When you build a new app, you get this error on deploy:

bundle exec cap production deploy
/Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/i18n.rb:4: warning: key :starting is duplicated and overwritten on line 6
cap aborted!
NoMethodError: undefined method on' for main:Object /Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/tasks/git.rake:12:in block (2 levels) in <top (required)>'
/Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/dsl.rb:14:in invoke' /Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/tasks/deploy.rake:35:in block (2 levels) in <top (required)>'
/Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/dsl.rb:14:in invoke' /Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/tasks/deploy.rake:4:in block (2 levels) in <top (required)>'
/Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/dsl.rb:14:in invoke' /Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/tasks/framework.rake:64:in block (2 levels) in <top (required)>'
/Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/tasks/framework.rake:63:in each' /Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/tasks/framework.rake:63:in block in <top (required)>'
/Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/lib/capistrano/application.rb:12:in run' /Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/gems/capistrano-3.0.1/bin/cap:3:in <top (required)>'
/Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/bin/cap:22:in load' /Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/bin/cap:22:in

'
/Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/bin/ruby_executable_hooks:15:in eval' /Users/sjohnson/.rvm/gems/ruby-2.3.1@appdata_home_page/bin/ruby_executable_hooks:15:in '
Tasks: TOP => git:check => git:wrapper
(See full trace by running task with --trace)

Doing a bundle update capistrano works but you have to update the Gemfile. Perhaps a more modern version of capistrano should be the default.

rvm PATH is not properly set up

I've made several attempts to get the rails-bootstrap app running.

Yesterday I couldn't get past an "Asset depends on 'bootstrap/glyphicons-halflings-regular.eot'" error. So today I've wiped and started again.

Now I can't get composer.rb to complete, viz:

 extras  Set a robots.txt file to ban spiders? (y/n) n
  extras  Create a GitHub repository? (y/n) n
  extras  Use or create a project-specific rvm gemset? (y/n) y
  extras  recipe creating project-specific rvm gemset and .rvmrc
  extras  creating RVM gemset 'guff'
  extras  switching to gemset 'guff'

WARN: Unresolved specs during Gem::Specification.reset:
builder (~> 3.1)
rake (>= 0.8.7)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
run rvm gemset list from "."
Warning! PATH is not properly set up, '/home/rails-dev/.rvm/gems/ruby-2.1.1@guff/bin' is not available,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.1.1@guff'.

gemsets for ruby-2.1.1 (found in /home/rails-dev/.rvm/gems/ruby-2.1.1)
(default)
fart
global
=> guff

  create    .ruby-version
  create    .ruby-gemset
  extras  recipe setting quiet_assets for reduced asset pipeline logging
  extras  recipe adding better_errors gem
  extras  Add 'therubyracer' JavaScript runtime (for Linux users without node.js)? (y/n) 

Missing expected options

I am currently following along the "rails-mailinglist-activejob" tutorial which makes use of the rails-bootstrap installation. I noted within the tutorial that we should expect the following prompt but this prompt never occurred within the composer tool:

"Use or create a project-specific rvm gemset? yes"

Note that this did not cause an issue but was not present and went immediately into gem installation after I selected "No" for "Create a GitHub repository?"

406 Not Acceptable Error

When using the rails generator I'm getting a 406 Not Acceptable error on open-uri.rb:

rails new test_app -m https://raw.github.com/RailsApps/rails-composer/master/composer

   apply  https://raw.github.com/RailsApps/rails-composer/master/composer

/Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:353:in open_http': 406 Not Acceptable (OpenURI::HTTPError) from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:708:inbuffer_open'
from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:210:in block in open_loop' from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:208:incatch'
from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:208:in open_loop' from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:149:inopen_uri'
from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:688:in open' from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:34:inopen'
from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.18.1/lib/thor/actions.rb:216:in apply' from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.2/lib/rails/generators/app_base.rb:101:inapply_rails_template'
from (eval):1:in apply_rails_template' from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.18.1/lib/thor/command.rb:27:inrun'
from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.18.1/lib/thor/invocation.rb:120:in invoke_command' from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.18.1/lib/thor/invocation.rb:127:inblock in invoke_all'
from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.18.1/lib/thor/invocation.rb:127:in each' from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.18.1/lib/thor/invocation.rb:127:inmap'
from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.18.1/lib/thor/invocation.rb:127:in invoke_all' from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.18.1/lib/thor/group.rb:233:indispatch'
from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.18.1/lib/thor/base.rb:439:in start' from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.2/lib/rails/commands/application.rb:43:in<top (required)>'
from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:64:in require' from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:64:inrequire'
from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.2/lib/rails/cli.rb:15:in <top (required)>' from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:64:inrequire'
from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:64:in require' from /Users/rwilliams/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.2/bin/rails:9:in<top (required)>'
from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/bin/rails:23:in load' from /Users/rwilliams/.rvm/rubies/ruby-2.0.0-p247/bin/rails:23:in

'

Using radio buttons and checkboxes with SimpleForm?

as: :select can be replaced with as: :radio_buttons or as: :check_boxes. You can use radio buttons if you prefer.

curious if anyone tried to switch to radio buttons as suggested. found when I did that the formatting/styling did not work.

Overall curious as to how easy it is to work with bootstrap to both add more features and customize. any other tutorials suggested.

thanks all

Google Drive: 403 Authentication failed

I'm following the rails-bootstrap tutorial that extends this example application.

I put in my gmail credentials but keep getting a 403 bad authentication. I understand this to mean my creds aren't correct but they are. I have not set up drive for this account, is there anything to do from gmails end? Also, do I need to put the credentials in quotes? Do I need to use the full gmail address? Tried a few things but none of it seems to fix the issue.

PS this is for when I'm trying to make my first post/entry about the coolest city.

Thanks

Survey Form problem

when I try to view the page after completing the Survey Form exercise, I'm getting an error . . . undefined method

undefined method `type_cast_from_database' for "string":String

Extracted source (around line #47):

  <div class="row">
    <div class="col-md-4 col-md-offset-4">
      <%= f.input :favorite, :collection => Visitor::IMAGE_LABELS,
        label: false, as: :select, prompt: 'Select a favorite...' %>
    </div>
  </div>

I double-checked that I had the visitor.rb, visitors_controller.rb and the routes.rb files exactly as written

Not sure what to try next

I like this project but...

It seems a little, well, misleading to tell the user to view the "Tutorial" that links to a paid site. Just saying....

Rails 5.2

Attempted to build the 'rails-bootstrap' example application with Rails Composer (built using rails_apps_composer 3.1.30) with Ruby 2.5.0 and Rails 5.2.0.rc1. Got the error:

init  recipe stage three
insert    config/secrets.yml
Error: The file /Users/danielkehoe/workspace/wip/rails-bootstrap/config/secrets.yml 
does not appear to exist

How to override the Bootstrap navbar-default-bg variable?

You can see a list of Bootstrap variables. For example, it shows @navbar-inverse-bg as a LESS variable.

The rails-bootstrap example app has a navigation partial that uses the navbar-inverse class from Bootstrap. The default background color is black. You can override the default:

// framework_and_overrides.css.scss
$navbar-inverse-bg: gray;
// import the CSS framework
@import "bootstrap";

I expected to be able to remove the navbar-inverse class from the navigation partial, and have a navbar like this:

<%# navigation styled for Bootstrap 3.0 %>
<nav class="navbar">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <%= link_to 'Home', root_path, class: 'navbar-brand' %>
    </div>
    <div class="collapse navbar-collapse">
      <ul class="nav navbar-nav">
        <%= render 'layouts/navigation_links' %>
      </ul>
    </div>
  </div>
</nav>

and then override the $navbar-default-bg variable like this:

// framework_and_overrides.css.scss
$navbar-default-bg: gray;
// import the CSS framework
@import "bootstrap";

but it didn't work.

The issue was originally reported here:
RailsApps/rails-composer#146

RAILS_ENV=production rake assets:precompile gives rake aborted error

Hi,

I'm using Bootstrap 3.0 and Rails 4.1.0.rc1. I'm able to successfully run the tutorial application locally, but when I try to precompile the assets using RAILS_ENV=production rake assets:precompile I get the following error:

$rails-bootstrap adrian$ RAILS_ENV=production rake assets:precompile
rake aborted!
database configuration does not specify adapter

It looks like thee database.yml file has changed structure (with Rails 4.1.0.rc1?), where the production: variables aren't defined. I tried adding the default variables to the production: and it seemed to allow Rails to precompile. Not sure if this is the correct solution.

thanks,

Adrian

Gemfile given in tutorial doesn't specify bootstrap-sass version

This isn't really an issue for the repo, but the tutorial said to report all issues here.

The gemfile for the tutorial currently lists -
gem 'bootstrap-sass'

which install bootsrap 3.0 and breaks the design / seems to stop the simple_form from working.

It looks like gem 'bootstrap-sass', '~> 2.3.2.2' was recently added to the repo, and just needs to be added to the tutorial.

Thanks.

[Rails 4.1] Sprockets error shows undeclared dependency

When using Bootstrap with Rails 4.1.0, when visiting any page of the rails-bootstrap example app, I get this error:

Sprockets::Rails::Helper::DependencyError at /
Asset depends on 'bootstrap/glyphicons-halflings-regular.eot' to generate properly but has not declared the dependency
Please add: `//= depend_on_asset "bootstrap/glyphicons-halflings-regular.eot"` to '/Users/danielkehoe/workspace/wip/rails-devise-pundit/app/assets/stylesheets/framework_and_overrides.css.scss'

This is because sanity checks from the sprockets_better_errors gem have been merged into Rails 4.1. The intent is to reveal asset pipeline errors that you would see in production when you run the app in development mode. See rails/sprockets-rails#96

To resolve this, the rails_layout gem should update the framework_and_overrides.css.scss file to include:

//= depend_on_asset "bootstrap/glyphicons-halflings-regular.eot"

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.