You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will create a saved! method within your component to raise the event.
You can override the internal method name using the alias option:
`raises :saved, alias: :save_it # defines the save_it method instead of saved!
For non-standard event names you can use the same syntax as the .on method uses, i.e.
raises '<SAVE>', alias: saved! # you must supply an alias for non-standard names
To attach a SAVE handler you say `.on('') (as you do today)
For example here is a sample component (see #51 for why there are no more params. prefixes)
classEditItemincludeHyperstack::ComponentincludeHyperstack::Observableparam:todoothers:othersraises:saveraises:cancelafter_mount{ ::Element[dom_node].focus}renderdoINPUT(@others,defaultValue: @todo.title,placeholder: "What is left to do today?",key: @todo).on(:key_down)do |evt|
nextunlessevt.key_code == 13@todo.update(title: evt.target.value)save!end.on(:blur){cancel!}endend
Activity
sfcgeorge commentedon Nov 15, 2018
Now called
triggers873f4f4Merge branch 'fix/backport-spec-hardening-52' into 'edge'
Backport two Rails 7 compatibility guards stranded on rails-7 (hypers…
Also fix the rspec cap and the Rails 7.1 serialize coder (hyperstack-…
Merge branch 'fix/rails7-compat-guards' into 'edge'
Backport the Zeitwerk autoloader contract fixes from rails-7 (hyperst…
Merge branch 'fix/zeitwerk-autoloader-contract' into 'edge'
Use secret_key_base, not the Rails-7.2-removed application.secrets (h…
Merge branch 'fix/rails72-secret-key-base' into 'edge'
Guard the classic-autoloader hooks removed in Rails 7 (hyperstack-org#52
Merge branch 'fix/rails7-autoloader-hooks' into 'edge'
SPIKE: a Rails 7.2 cell on edge, to find out what the Rails axis costs (
rails-hyperstack: add javascript_include_tag to the generated layout (h…