GithubHelp home page GithubHelp logo

your-own-js-and-css-in-rails's People

Contributors

aviflombaum avatar bhollan avatar blake41 avatar cbdileo avatar dependabot[bot] avatar maxwellbenton avatar rrcobb avatar sgharms avatar

Watchers

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

your-own-js-and-css-in-rails's Issues

brew install phantomjs failed

I received the error about phantomjs not being on my system. I tried brew install phantomjs as suggested in the Readme, however it resulted in a bunch of errors and failed to install. I found the following workaround, which fixed the issues I was having, and I wanted to share as an alternative in case anyone else has trouble installing.

npm install phantom phantomjs -g

Weird Puma Error

I received a weird puma error after getting rid of the Gemfile.lock, and running bundle install

LoadError: Capybara is unable to load pumafor its server, please addpumato your project or specify a different server via something likeCapybara.server = :webrick.

Not sure what it is, but I am almost certain I have completed what the specs are testing for. Any feedback would be much appreciated!

JQuery Prevents Tests From Passing

A number of these javascript libs include JQuery by default, but actually using any JQuery will often prevent the tests from passing, even if the code correctly implements the required features.

It may be best to simply remove JQuery from these labs if the tests are not going to be written to allow its use.

Tests dont pass using let to declare variables instead of var

Using let results in the following error:
Capybara::Poltergeist::JavascriptError:
One or more errors were raised in the Javascript code on the page. If you don't care about
these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (s
ee documentation for details).

   ReferenceError: Can't find variable: hideWhenClicked

PhantomJS error

I encountered the phantomJS error, after a bit of searching and head scratching I saw the note about this error at the bottom of the lab readme to run brew install phantomjs upon running that line in the terminal I was vexed to encounter the same issue again. Upon reading through the error in the terminal - the update is: brew cask install phantomjs (the cask had been left out)

Just a heads up - you might want to update.
sorry for the long explanation.

Duplication in the text of this lab

The text was copied and pasted twice in this lab. It should end after the first Phantom JS Errors section.

Objectives
Write your own CSS and integrate it into the asset pipeline and use it in views.
Write your own JS and integrate it into the asset pipeline and use it in views.
Objectives
Located in this repository is a simple Rails application. Your goal is to create your own JS and CSS and include it into the application. You can run the Capybara spec when you are finished to test your solution.

First add the following JS:

In /app/assets/javascripts/ create the file hide.js
Create the function hideWhenClicked that hides the element that was clicked.
Make sure to bind to #hide_this
Add hide.js to your JS manifest.
Note: If declaring any variables in your JavaScript file, use var instead of let or const or else Capybara will throw this error:

Capybara::Poltergeist::JavascriptError:
One or more errors were raised in the Javascript code on the page. If you don't care about
these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (s
ee documentation for details).
Next add the following CSS:

In /app/assets/stylesheets/ create the file links.css
Create a CSS class called .error that changes the color of the text to red. Add this CSS class to the link on the root page.
Create another CSS class called .cool-background that makes the background grey. Add this CSS class to the tag on the application layout.
Add links.css to your CSS manifest.
PhantomJS Errors
If you receive this error:

Could not find an executable ["phantomjs"] on your path.

Install it with: `# Your Own Js And Css In Rails

Objectives
Write your own CSS and integrate it into the asset pipeline and use it in views.
Write your own JS and integrate it into the asset pipeline and use it in views.
Objectives
Located in this repository is a simple Rails application. Your goal is to create your own JS and CSS and include it into the application. You can run the Capybara spec when you are finished to test your solution.

First add the following JS:

In /app/assets/javascripts/ create the file hide.js
Create the function hideWhenClicked that hides the element that was clicked.
Make sure to bind to #hide_this
Add hide.js to your JS manifest.
Next add the following CSS:

In /app/assets/stylesheets/ create the file links.css
Create a CSS class called .error that changes the color of the text to red. Add this CSS class to the link on the root page.
Create another CSS class called .cool-background that makes the background grey. Add this CSS class to the tag on the application layout.
Add links.css to your CSS manifest.
PhantomJS Errors
If you receive this error:

Could not find an executable ["phantomjs"] on your path.

Install it with: brew cask install phantomjs

`brew cask install phantomjs` doesn't work on windows

The instructions say to install phantomjs with brew cask install phantomjs, however, that does not work on Windows. To install it, add the gem ‘phantomjs’, :require => ‘phantomjs/poltergeist’ to your gemfile. Delete gemfile.lock first and then bundle install.

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.