Questions tagged [arbre]

Arbre is a Ruby gem that implements Ruby Object Oriented HTML Views.

Arbre is the DOM implemented in Ruby. Arbre is primarily used as the object oriented view layer in Active Admin.

Resources:

19 questions
7
votes
1 answer

Active Admin : Can't access show/edit pages

I'm having an issue with Active Admin. Here are the versions : ruby '2.2.1' rails '4.2.0' activeadmin : 1.0.0.pre1 arbre : 1.0.3 (mentioning this one because it seems to be linked to my issue somehow) We upgraded to rails 4.2 and had to upgrade…
BPruvost
  • 503
  • 2
  • 5
  • 16
7
votes
2 answers

How can I have a div with multiple children in ActiveAdmin/Arbre

I have this code: div class: item.ui_type do link_to image_tag(item.image.image_public_url), item.target) link_to item.label, item.target end Basically, I want a div with 2 links inside. However, only the last element is getting rendered,…
Daniel Magliola
  • 30,898
  • 61
  • 164
  • 243
4
votes
1 answer

Active Admin Rails 4 inline form

I am using on Rails 4 ActiveAdmin and Money-Rails. Is there a way to have two or more inputs in a single line of text? para "Please enter the amount" f.input :amount_due_currency, :label => "Dollars ",:input_html => {:style => 'width:3%'} para…
Joseworks
  • 541
  • 1
  • 6
  • 20
3
votes
1 answer

How do I do a paragraph ("p") tag in Arbre?

I can do a div tag like this: 2.1.0 :014 > Arbre::Context.new { div "foo" } =>
foo
And a span tag like this: 2.1.0 :017 > Arbre::Context.new { span "foo" } => foo But this convention doesn't work for the p (paragraph)…
Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
3
votes
1 answer

How to DRY up arbre code into a reusable component?

I have a common pattern or repeated code that I'd like to DRY up in my ActiveAdmin views. I'm using arbre components to render as much of my views as I can and I'd like to keep it that way if possible (i.e. I don't really want to convert to straight…
pdobb
  • 17,688
  • 5
  • 59
  • 74
1
vote
1 answer

Rails 6 Active Admin render Arbre partial within Arbre form partial

Ruby 2.7.4 Rails 6.1.3.2 Active Admin 2.9.0 Arbre 1.4.0 I am having trouble rendering a small partial _person_fields.html.arb inside the main form partial _form.html.arb. I am using the Arbre components columns and column in the partial. But it…
1
vote
1 answer

How to write conditional ruby code to show in form of .arb file (Active Admin)

I want to fetch the Attachment Model's attribute name(pdf_file.file_name) based on condition (if..else). But I am not familiar with Arbe Syntex and cant show the outputs in view. I am rendering a partial file from my active_admin class. The code in…
1
vote
1 answer

Rails render regular erb partial to active admin layout (arb)

I'm trying to add a view that LOOKS like active admin, but doesn't need to take advantage of active admin's automatic page creations (in fact I can't because I'm not using a model for these views). In my controller, I've added render…
Silvertail
  • 169
  • 1
  • 13
0
votes
1 answer

Load a specific tab in tabbed page in ActiveAdmin

I'm using tabs and would like to have some custom buttons that change what is displayed on the screen such as: add an element to an array we are displaying, or reorder the elements in the array and show display it. This causes the admin page to…
kmfsousa
  • 183
  • 1
  • 1
  • 11
0
votes
1 answer

How to use scripts in Arbre?

In the docs it says that to put JavaScript into Arbre you must use script { raw ... }. At first I understood from this to write script { raw [insert code here]}. With the word raw as being part of it. That didn't work. So then I thought it might be…
Victor BC
  • 103
  • 4
0
votes
1 answer

How to define class in and Arbre block?

Sorry if this is a stupid question, but I would like to know how one can go about defining a class in an Arbre block. I tried to simply put the comma after the block, but Ruby accuses it of an error (specifically: "unexpected token tCOMMA (Using…
Victor BC
  • 103
  • 4
0
votes
2 answers

In Active Admin / Arbre form, how I can put HTML (specifically a line break) in a label?

This is a little unorthodox, but I don't think it should be difficult. I have a Active Admin form: form do |f| f.semantic_errors(*f.object.errors.keys) f.inputs do f.input :email f.input :name # read-only field that still matches…
Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
0
votes
1 answer

How can I apply syntax highlighting to an ActiveAdmin row?

I'm storing Ruby code in a database so that if an administrator needs to tweak the code logic, they use ActiveAdmin to make edits. My app is written in such a way to load & call this code from the database. My problem now is that the text rendered…
chemturion
  • 283
  • 2
  • 16
0
votes
1 answer

How do I add tabindex="0" to every
  • in Arbre
  • I'm updating some old code to be ADA compliant and need to give each
  • in the nav tabindex="0" so they are all accessible via keyboard. This is the code that generates the navigation
  • s. It wasn't written by me and I only knew what Arbre was…
  • 0
    votes
    1 answer

    How to use Rails' simple_format with special characters?

    On Rails 3.2.13, simple_format does not return what I expect it to do, on an admittedly convoluted case: > simple_format("a <= 2, b < 4") "

    a < 4

    " Since this case does not seem to work properly (I'm losing half my string!), is there a way…
    F.X.
    • 6,809
    • 3
    • 49
    • 71
    1
    2