We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create form helpers courtesy of @afomera
require "action_view/helpers/tags/placeholderable" module ActionView::Helpers class Tags::RhinoEditor < Tags::Base include Tags::Placeholderable def render options = @options.stringify_keys options["value"] = options.fetch("value") { value&.to_trix_html } add_default_name_and_id(options) @template_object.rhino_editor_tag(options["name"], options["value"], options.except("value")) end end module FormHelper def rhino_editor_field(object_name, method, options = {}) Tags::RhinoEditor.new(object_name, method, self, options).render end end class FormBuilder def rhino_editor(method, options = {}) @template.rhino_editor_field(@object_name, method, objectify_options(options)) end end end module TagHelper cattr_accessor(:id, instance_accessor: false) { 0 } include Rails.application.routes.url_helpers def rhino_editor_tag(name, value = nil, options = {}) options = options.symbolize_keys content_tag("div") do hidden_field_tag(name, value) + tag("rhino-editor", { input: options[:id], data: { "blob-url-template": rails_service_blob_url(":signed_id", ":filename"), "direct-upload-url": rails_direct_uploads_url } }.merge(options)) end end end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Create form helpers courtesy of @afomera
The text was updated successfully, but these errors were encountered: