Rails Admin global label change - ruby-on-rails

There is a label tag to change the label of an attribute, but it has to be mentioned for every tab. For ex. If I have an attribute abc but I want the label as ABC (not Abc that happens automatically), but I want all other labels to remain as they are, I am having to go and edit each block like SHOW, LIST, EDIT etc individually and set a label for that attribute in all those options after which I will also have to include defaults.
Is there any way to do it globally, like to set label of an attribute globally in a model based configuration so that I don't have to do it individually and it reflects in all the tabs.
Note : I am configuring rails admin in every model using rails_admin block

Related

How to define dynamically the label of a 'text field' control in Orbeon Forms?

I wish to ask you if it is possible to define dynamically the label of a 'text field' control when a form is loaded. Actually, I need to pass the label value through a URL parameter and use this value to define the label. Is that possible? I've made a research for a similar case but I cannot find a way to get the value of a url parameter and set it as a control's label before the form is displayed in the user.
Regards,
George
In the Control Settings for your control, in the Label tab, do something as follows. Here I'm getting the value of the foo request parameter, but you'll most likely want to use a more meaningful name.
That's it, really: with this, when you load your form, say with the URL http://localhost:8080/orbeon/fr/a/a/new?foo=bar, the control will get "bar" as its label. Also see Template syntax.

Select or input

In my app I have a form for creating new trip. Model Trip has field finish_address. For setup the finish_address in I use select in simple form to select address from user's addressbook. But I want to make a better form: if there isn't necessary address, user can add it using input field.
So I need to make form with to types of setup finish_address. How can I make it?
You have 2 basic options.
You can use autocomplete on a text input, populating a dynamic crop-down with know values.
There are several gems available to get you started in this direction, like https://github.com/crowdint/rails3-jquery-autocomplete.
Alternatively, you can add an "other" option to a select input, populated with your known values. When the "other" item is selected, display a previously hidden text input with the same name below the select input. The "lowest" element will take precedence, for what gets sent to the controller.
In the controller, just do a find_or_create_by, using your provided value.
These options both require javascript, but you can eliminate the need for javascript if you make your select a non-db-backed attribute, and manipulate your params accordingly, as they come in to the model. This might help with validations, as well.

TFS 2013 - Description HTML Field Can't Be Required

Fellow TFS users and/or junkies,
We are using TFS 2013. When I add required for Description HTML (Microsoft.VSTS.Common.DescriptionHTML), the default value still shows up as "As a I want so that ", THUS it doesn't require the user to fill anything in and it doesn't show up yellow. Sure, I could change the field, but we already have many things linked to Description HTML and can't risk changing the fields (reports and such are already setup). How would I change this so either:
A. It is empty and will show up required OR
B. It requires the user to change the value
Things I tried:
Setting the value to empty. Won't allow me to have both empty AND required.
Setting Default Value to empty. Won't allow me to that either.
Setting Prohibited Values to the default text it has. Not allowed for the field.
Applying a WhenNotChanged rule for the field and setting it to required. It already has a value so it doesn't matter if it's required or not.
I've just looked into a similar tfs machine.
It's just a defined "Default" rule but not in the "Fields" tab but in workflow tab.
In my case, it was in the initial transition rule.
To be specific:
Like you can guess, using Power Tools;
open the work item
go to the "Workflow" tab.
In the designer, double click the (most possibly) first transition element to view its settings
In the window opened, go to the "Fields" tab
If you see "Description" field there, double click it
Remove the "Default" rule
Now, you don't have a default text. You can set it "Required" and it'll be ok.
Close all, go to Fields tab of work item and set a required rule in a way as you expected initially.

Joomla 3 menu item URL appened

Joomla version 3 menu item has a field called "Note" which is primarily used to display notes in the administrator backend.
I have populated "note" field with something like "&City=4&County=0" Now I want to append this in front of the Link URL. Link URL is none editable field which is automatically populated based on article selected so I cannot edit or type in it manually.
Normal URL based upon selection of the article looks like something this:
index.php?option=com_content&view=article&id=10
Now I want to append the note field in front of this URL so the URL would look like:
index.php?option=com_content&view=article&id=10&City=4&County=0
Here is the screenshot:
(source: linkbank.co.uk)
You could make a new view, just copy components/com_content/views/article to cityarticle or something meaningful, then edit the default.xml you find in its subfolder ./tmpl, change the name so you can identify it and add the fields city and county to the
on line 16 roughly, those will appear when you create a new menu item (on the right) so you can set them, and will be passed on as get requests.
Choose the appropriate field type and read the docs here:
http://docs.joomla.org/Standard_form_field_and_parameter_types

run SPD workflow on changes to any field EXCEPT one?

I have a custom list. Each item in the list has 39 fields/columns that need to be filled out and a 40th field that gets filled out by a separate workflow.
I have another workflow that I need to trigger if any of the fields change EXCEPT for one.
Why? Because that field has a custom ID# in it and that field gets populated AFTER the form is submitted. Therefore, there will ALWAYS be a change in the list item. Thus, I need a workflow to trigger when any fields change EXCEPT the one w/ the custom ID#.
Any ideas? Thank you.
No one has been able to answer this but I figured it out myself.
I'm including the answer here in case anyone else ever comes across this and finds it helpful:
Create a new field that you will hide from the your SP list and from NewForm.aspx, EditForm.aspx, and DispForm.aspx.
Using jQuery, populate that hidden field as such: $(":input[Title='fieldName']").val("1");
The using an SPD workflow, check to see if that field = 1. If so, run the workflow. AND at the end of that workflow set the field to 0 - that's important.

Resources