ruby-on-rails

Rails Sass: variables are not passed with @import

﹥>﹥吖頭↗ 提交于 2021-02-20 06:50:17
问题 I have a rails project which uses twitter bootstrap and sass. The scss files are structured into folders so I have a better overview. Now I want to define a file for global variables which contains my colors etc. and pass those values down to other files so I have less redundant code. While all code is properly imported and applied, variables don't work. Here is the current setup: stylesheets/application.css.scss /* *= require_self *= require_tree */ /* stylesheets/ | |– base/ | |– _reset

Rails Sass: variables are not passed with @import

半腔热情 提交于 2021-02-20 06:49:10
问题 I have a rails project which uses twitter bootstrap and sass. The scss files are structured into folders so I have a better overview. Now I want to define a file for global variables which contains my colors etc. and pass those values down to other files so I have less redundant code. While all code is properly imported and applied, variables don't work. Here is the current setup: stylesheets/application.css.scss /* *= require_self *= require_tree */ /* stylesheets/ | |– base/ | |– _reset

Reset the id field in a table in a sqlite db in Rails

时光毁灭记忆、已成空白 提交于 2021-02-20 04:59:07
问题 Im using sqlite db in a sample rails application. From my users table, i have cleared all records using User.delete_all . But now whenever i insert a new record in the table using User.create , the id is starting at a value which is one more than the id of the last record which was there in the table. For example, if my table had 5 records and i cleared all, then when i do User.create, its starting at id 6. Is there any way i can make the id start from 1 again ? Thank You 回答1: Similar

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at

故事扮演 提交于 2021-02-20 00:48:29
问题 I tried using a web app that would access h20 flow using REST API routes and when I tried to delete a frame (it would delete the frame after predicting), this happens: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://139.59.249.87:54321/3/Frames/1i3uso. (Reason: CORS header 'Access-Control-Allow-Origin' missing). I'm using ruby rails in order to build the web app. Any advice? I used this route: DELETE /3/Frames/{frame_id} and this coffee

Bundler using wrong Ruby version

走远了吗. 提交于 2021-02-19 16:10:36
问题 When I try to start my Rails server, I get the following error: $ bundle exec rails s Your Ruby version is 2.3.7, but your Gemfile specified ~> 2.3.8 I don't understand why that happens though, since I set Ruby to 2.3.8 both using Homebrew and using rbenv. 2.3.7 is the version of the system's ruby. I am using Mac OS 10.14.4. $ ruby -v ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-darwin18] $ rbenv version 2.3.8 (set by /Users/ceasar/foo/.ruby-version) $ which -a ruby /Users/ceasar/.rbenv

Bundler using wrong Ruby version

一曲冷凌霜 提交于 2021-02-19 16:08:38
问题 When I try to start my Rails server, I get the following error: $ bundle exec rails s Your Ruby version is 2.3.7, but your Gemfile specified ~> 2.3.8 I don't understand why that happens though, since I set Ruby to 2.3.8 both using Homebrew and using rbenv. 2.3.7 is the version of the system's ruby. I am using Mac OS 10.14.4. $ ruby -v ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-darwin18] $ rbenv version 2.3.8 (set by /Users/ceasar/foo/.ruby-version) $ which -a ruby /Users/ceasar/.rbenv

Bundler using wrong Ruby version

一世执手 提交于 2021-02-19 16:06:37
问题 When I try to start my Rails server, I get the following error: $ bundle exec rails s Your Ruby version is 2.3.7, but your Gemfile specified ~> 2.3.8 I don't understand why that happens though, since I set Ruby to 2.3.8 both using Homebrew and using rbenv. 2.3.7 is the version of the system's ruby. I am using Mac OS 10.14.4. $ ruby -v ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-darwin18] $ rbenv version 2.3.8 (set by /Users/ceasar/foo/.ruby-version) $ which -a ruby /Users/ceasar/.rbenv

Bundler using wrong Ruby version

不羁的心 提交于 2021-02-19 16:06:26
问题 When I try to start my Rails server, I get the following error: $ bundle exec rails s Your Ruby version is 2.3.7, but your Gemfile specified ~> 2.3.8 I don't understand why that happens though, since I set Ruby to 2.3.8 both using Homebrew and using rbenv. 2.3.7 is the version of the system's ruby. I am using Mac OS 10.14.4. $ ruby -v ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-darwin18] $ rbenv version 2.3.8 (set by /Users/ceasar/foo/.ruby-version) $ which -a ruby /Users/ceasar/.rbenv

Bundler using wrong Ruby version

本秂侑毒 提交于 2021-02-19 16:04:54
问题 When I try to start my Rails server, I get the following error: $ bundle exec rails s Your Ruby version is 2.3.7, but your Gemfile specified ~> 2.3.8 I don't understand why that happens though, since I set Ruby to 2.3.8 both using Homebrew and using rbenv. 2.3.7 is the version of the system's ruby. I am using Mac OS 10.14.4. $ ruby -v ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-darwin18] $ rbenv version 2.3.8 (set by /Users/ceasar/foo/.ruby-version) $ which -a ruby /Users/ceasar/.rbenv

Check element visibility that is visible for less than a second in Rails Capybara

房东的猫 提交于 2021-02-19 08:02:16
问题 I am trying to write an integration test in which I must check the visibility of an element on button click. The code works perfectly in one machine and failing in the other. The element is displayed until the data comes from the backend. So its visibility depends on the speed of the machine also. Is that the problem? This is the code: assert page.has_css?('#my_element_id') assert find('#my_element_id', visible: true) But I am getting an error: expected false to be truthy . Is there any other