inline_svg
opal-rails
inline_svg | opal-rails | |
---|---|---|
1 | 4 | |
685 | 485 | |
- | 0.0% | |
5.6 | 5.4 | |
6 months ago | 11 months ago | |
Ruby | Ruby | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
inline_svg
-
Adding a Star Rating with Hotwire
The best way to style an SVG icon (which is one of the big advantages of the format, in my opinion) is to embed the SVG in the HTML document (render it inline with the rest of the HTML) and from there apply CSS styles as you might expect. There's a gem called inline_svg that we'll make use of to make that easier.
opal-rails
-
Opal v1.7 released with Ruby 3.2 support
Opal itself aims just at creating a Ruby runtime and a couple of life improvements, but there exist a couple of helper gems, for instance Opal-Browser (for an idiomatic API to interact with DOM and other browser APIs), Opal-Rails (for integrating with a Sprockets pipeline of Rails), Opal-RSpec (to test your frontend application). There exist a number of libraries and bindings to JS libraries for Opal.
-
Opal 1.5.0 released - compile Ruby to JS and run it in a browser
For Rails integration we provide opal-rails, a Gem, that after inclusion will transparently handle .rb files in your JavaScript asset directory (via Sprockets). To interface with a web browser, you would also need to use opal-browser. As an alternative you can use Hyperstack, which deeply integrates React, Rails and Opal.
-
Opal 1.3 released
Opal itself is a low-level thing, not depending on Rails whatsoever. We provide an official Gem for integration with Rails that integrates everything nicely and allows you to have .rb files in your JavaScript assets directory. Unlike Rails, Opal is not opinionated, to interface with web browser APIs properly you need to either use a library that wraps DOM directly, use a similar one that wraps jQuery or use Hyperstack, a fully-fledged Rails-integrated framework based on React that also allows you to share your models between frontend and backend. It's also possible to not use any of those and interface JavaScript APIs directly using an API that looks like this: $$[:document][:location].replace("https://opalrb.com/") or simply embed JavaScript with a backtick notation: `document.location.replace(#{@url})`.
- Opal 1.2 (a Ruby implementation in JavaScript) released with Ruby 3.0 support
What are some alternatives?
Decent Exposure - A helper for creating declarative interfaces in controllers
Opal - Ruby ♥︎ JavaScript
EasilyTypable - Ruby module that facilitates English-like type checking in an inheritance hierarchy via "type_name?" methods
TryRuby - This 4th iteration of TryRuby is a website where you can learn the Ruby language.
Rails Event Store - A Ruby implementation of an Event Store based on Active Record
spec - The Ruby Spec Suite aka ruby/spec
Rectify - Build maintainable Rails apps
opal-browser - Browser support for Opal.
Smart Init - Simple service objects in Ruby - A simple gem for eliminating Ruby initializers boilerplate code, and providing unified service objects API
opal-rspec - Opal + RSpec = ♥️
Amoeba - A ruby gem to allow the copying of ActiveRecord objects and their associated children, configurable with a DSL on the model
opal-jquery - jQuery for Opal