我一直在Ruby on Rails中做一個項目,我需要你的幫助。到目前爲止,我已經設法創建了一個非常基本的博客,可以創建,閱讀,更新和刪除博客文章。也可以對特定的帖子發表評論。然而,我一直在嘗試一些bootstraps,看起來好像我找不到有關如何在Rails 4.0或更高版本的現有Rails項目中使用它的更新文章。更改現有Rails應用程序的佈局
現在我真的只想添加一個佈局到應用程序,但它甚至可以不使用引導程序?這裏是的Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
這裏是application.html.er:
<!DOCTYPE html>
<html>
<head>
<title>Blog</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
這裏是application.css:
*= require_tree .
*= require_self
在我的樣式表文件夾中我得到的文件comments.scss,posts.scss,scaffolds.scss。但我的大問題是,接下來我要做什麼來改變應用程序的設計?
好的,謝謝!但是,甚至可以在不添加任何引導程序的情況下使用html/css獲得美觀的視圖? – Nitram
是的,引導它只是一個快速演示或構建網站的框架,而不會花費太多時間在HTML/CSS – rorra