Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal-rails
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f6da4a9f01d8
Choose a base ref
...
head repository: opal/opal-rails
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dcbf30439b14
Choose a head ref
  • 3 commits
  • 1 file changed
  • 2 contributors

Commits on May 27, 2015

  1. Fix the first steps instructions for new users

    If the users follow current instructions they will hit the wall at the moment. The example using Ruby require syntax does not work at all. The example using sprockets commetns syntax will raise ruby syntax errors in editors such as RubyMine or Vim (because // is not valid Ruby comment syntax).
    
    This change fixes both issues:
    - clarifies which syntax can be used for which versions of Ruby
    - uses # comment syntax instead of // for better support of Ruby syntax aware editors
    hubertlepicki committed May 27, 2015
    Copy the full SHA
    06e0d0f View commit details
  2. Copy the full SHA
    0f8f715 View commit details
  3. Merge pull request #53 from hubertlepicki/patch-1

    Fix the first steps instructions for new users
    elia committed May 27, 2015

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    dcbf304 View commit details
Showing with 8 additions and 6 deletions.
  1. +8 −6 README.md
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -64,17 +64,19 @@ Now ships with a patch to sprockets cache key to include processor version that
You can rename `app/assets/javascripts/application.js` to `application.js.rb`. Even if not necessary, it is recommended to change Sprockets' `//= require` statements to Ruby' `require` methods.
Sprockets' `//= require` statements won't be known by the opal builder and therefore you can end up adding something twice.

Both of the following examples would work:
For Opal 0.7 and below, the following example should work:

```js
```ruby
# app/assets/javascripts/application.js.rb

//= require opal
//= require opal_ujs
//= require turbolinks
//= require_tree .
#= require opal
#= require opal_ujs
#= require turbolinks
#= require_tree .
```

For Opal 0.8 and above, you should be able to use the following syntax:

```ruby
# app/assets/javascripts/application.js.rb