Scenario is : User has many comments.
Now I have to create a form in four steps to create user and his comments.
In step 1, 2, 3 I will ask from the user to fill his profile details like first_name, email, address etc. and in the forth step there will be a button called as "ADD Comment"
When the user will click on ADD comment button a popup will open with the "Save comment" button in that he will fill up the comment title, text etc and after filling all the information he will click on "Save Comment" button and then popup will disappear and on the same page that comment will append so row by row all added comments will be shown in the table format. Also every row will have the delete icon to delete a comment.
Now this step four is the final step that will have the "Submit" button and when user will click on that all information should be save.
How can I accomplish this task ? What is the best way to approach this ?
The ideas those I have like:
1) When user will click on next button on the third step then I can create a user and that object I can pass in the forth step to create his comments.
2) or Create both the user and comments when he click on Submit button using accepted_nested_attribute.
3) Create the comment in the database when user will click on "Save comment"
Please suggest a fully better solutions.
Thanks
Anand
You could create a StepsController with all your actions or I would suggest that you look at the wicked gem for creating easy multistep forms.
Related
So i have this page called ticket amount which has a bunch of buttons on it.
Wha im wanting is for the user to click the button on the row of the search results and be taken to that page. The user will then click on the amount of tickets they want and be taken to the page that matches the id from the from the row the button was on.
Basically at the moment its going
Search results >>>>> results
And i want
Search results >>>>> ticket amount >>>>> results
I've currently got the first one set up like this
<%= link_to 'Compare', event_path(event.id), class: "btn btn-info" %>
How would i go about making it different? Basically i'm wanting to use the amount of tickets the user selects in the view. So probably best to change the url from this
/events/idnumber
to
events/idnumber/tickets_required=4
Any ideas how to do this?
At the moment the ticket_amount.html only has basic bootstrap buttons inside
What you need to do is to send the params in a redirect_to.
What I would do is a small form for let the user select the tickets_required, the form will point to an action in the controller, within that action I would add a redirect to the search results url sending the param:
#Within your controller action once the user selects the tickets_required
redirect_to event_path(event, tickets_required: params[:tickets_required])
Redirect to the search results url or event_path or whatever, and send the tickets_required param in the url using the param[:ticket_required] coming from the form submission
Take a look to this thread that will guide you about how to send the params in the redirect_to
I want to use ASP.NET MVC to create a registration page.
The registration page will have a single view and it will have multiple forms. The user can use "back" and "continue" buttons to go to a form (partial form).
First step:
On Form1, the user will enter his name, email and click "continue" which should do a postback and validate the form inputs. If form is valid, display form 2.
Second Step:
The user will add his company address and then click on "Done".
How can I create such a form in multiple steps?
I want to use ASP.NET MVC to create a registration page. The registration page will has a single URL and it will have many forms. The user can use "back" and "continue" buttons to go to a form (partial form).
FIRST STEP: The user will enter his name, email, .. in Form1 Then he should click on "continue"--> Postback and validation of inputs. SECONED STEP: If Form1 is OK and the user has clicked the "continue"-button the second form (Form2) will appear. The user will add his company address and then click on "Done".
How can I create such a form in multiple steps?
Hi i'm new to rails and i would like tohave number_field to show out after the user clicked the radio_button. For example, i have 3 radio_buttons. If the user clicked the 2nd one, it'll then show a number field to ask the user to enter some data required and later on pass to a function defined in controller after user click submit button.
2/28: Seems the Go uri is only if you create your own persisten layer. I'm going to try and use a link on my form to do this. If I can figure out how to find the form_id of the current form.
Original Question:
I'm trying to restrict who can delete a form instance. It seems if people can get to the form-runner summary page, they can click the delete button and delete a form (even if they are not allowed to do any "/orbeon/fr/hr/expense-report/edit/*" options.
Anyone found a way around this issue. I wonder if we could use the GO button on the form /edit/ view to build our own delete feature.
If I look at the page source from the hr/expense-report/edit/f36b446c3ddbf7c63ec033d5c6fa7ce4 view, that the from does have the details to the actual form instance.
Example:
form id="xforms-form" class="xforms-form xforms-initially-hidden xforms-layout-nospan" action="/orbeon/fr/Test/Hidden_Search/edit/f36b446c3ddbf7c63ec033d5c6fa7ce4"
I wonder if that information could be passed to the "GO" button, if I have that on my page?
Right now, if users can access the Form Runner summary page, they can also access the "delete" button. Showing the "delete" button on the summary page for some users but not others, requires a change to Form Runner, which shouldn't very complicated.
For instance, if you only want the "delete" button to be shown for users with the role can-delete, on this xforms:bind of fr/summary/view.xhtml add the attribute:
relevant="xxforms:is-user-in-role('can-delete')"
I have created a new custom list form that will show 4 fields on the page from a Custom List called "Shipment". I have added Form Action button that I would like to run a custom action that is set inside of a Workflow. Currently, the form displays the fields for "Manifest Number", "Pickup Location", "Delivery Location", & "Scheduled Pickup Time". When the user clicks the Form Action button, what I want the Workflow to do is go to the ID field of the displayed content in the Form and change the value of the "Picked Up" column from No to Yes. The problem I am having is passing the ID of the displayed information from the Form to the Workflow as a variable. I can get the "Picked Up" column to update if I specify the value in the "Update List Item" window under the "Find the List Item" section, but I cannot figure out how to do this dynamically from the Form
You need to add a hidden field to store the ID in the custom list form. Copy the line that displays "Manifest Number" and change it to point to the ID field. And the change the variable name to ff6 or something like that (given you already only have 5 fields). Now when you open the custom action workflow in SPD the ID field should be available for your apply as a filter.
Hope this helps.