Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Pre-built easy to use reactive TurboReflex behaviors for Rails/Hotwire apps.
Proudly sponsored by
>=2.7.3
>=6.1
>=1.1
>=7.2.0
>=7.2.0
>=0.1.2
>=0.0.28
Be sure to install the same version for each libary.
bundle add "reflex_behaviors --version VERSION"
yarn add "reflex_behaviors@VERSION --exact"
Import and intialize ReflexBehaviors in your application.
# Gemfile
gem "turbo-rails", ">= 1.1", "< 2"
+gem "reflex_behaviors", "~> VERSION"
# package.json
"dependencies": {
"@hotwired/turbo-rails": ">=7.2",
+ "reflex_behaviors": "^VERSION"
# app/javascript/application.js
import '@hotwired/turbo-rails'
+import 'reflex_behaviors'
Toggle content via conditional rendering.
This example will re-render the post
partial and toggle the form
section.
<!-- app/views/posts/_post.html.erb -->
<%= tag.div id: dom_id(post) do %>
<!-- content -->
<%= toggle_trigger_tag renders: current_partial_path, morphs: dom_id(post),
controls: dom_id(post, :form), locals: local_assigns, assigns: { post: @post }) do %>
<% if toggle_target_collapsed? dom_id(post, :form) %>
<%= link_to "Edit Post Inline", request.path %>
<% else %>
<%= link_to "Cancel Editing Post", request.path %>
<% end %>
<% end %>
<%= toggle_target_tag dom_id(post, :form) do %>
<%= render "posts/form", post: post %>
<% end %>
<!-- content -->
<% end %>
toggle_trigger_tag
renders
- REQUIRED, the partial path to rendermorphs
- REQUIRED, dom_id
of the partial's outermost containing elementcontrols
- REQUIRED, dom_id
of the toggle targetassigns
- {}
, assigns
required to render the partial i.e. instance variableslocals
- {}
, local_assigns
required to render the paritalcollapse_selector
- nil
, CSS selector for other targets to collapse when the target is expandedfocus_selector
- nil
, CSS selector for the element to focus when the target is expandedmethod
- :toggle
, reflex method to inovke (:show, :hide, :toggle)disabled
- false
, disable the triggerremember
- false
, remember state between requestskwargs
- generic support for additional element attributes like class
etc.&block
- a Ruby block that emits the rendered contenttoggle_target_tag
id
- REQUIRED, the dom_id
for the elementcollapse_on
- []
, list of events that trigger collapsecollapse_selector
- nil
, CSS selector for other targets to collapse when this target is expandedexpanded
- false
, override to force expansionfocus_selector
- nil
, CSS selector for the element to focus when content is expanded
kwargs
- generic support for additional element attributes like class
etc.&block
- a Ruby block that emits the rendered contentyarn
and bundle
to pick up the latestlib/reflex_behaviors/version.rb
. Pre-release versions use .preN
rake build
and yarn build
bin/standardize
rake release
yarn publish --no-git-tag-version
-preN
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that reflex_behaviors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.