similar to: Multiple actions from one form - possible?

Displaying 20 results from an estimated 200 matches similar to: "Multiple actions from one form - possible?"

2006 Mar 14
6
How to provide 2 actions to a form?
Hi, I have a form in rhtml. Now I have 2 buttons indside that form. Clicking on the first button action will be ''create'' & on second button action will be ''delete''. How to do this? Thanx Prash -- Posted via http://www.ruby-forum.com/.
2006 Feb 27
2
submit_tag
How can i use the submit_tag method (from: actionView::FormTagHelper) to create various submit buttons and chose the right action in accord to the button that i pushed? -- Posted via http://www.ruby-forum.com/.
2006 Apr 03
3
render :partial + redirect_to :controller
This is of course disallowed, which I discovered only after nearly completing my spanking new ajaxified UI. What is the motivation behind this, and what is the best workaround? This UI does a scriptaculous drag-and-drop of items from a first div (div1) over to a second div (div2), which triggers the contents of div2 to be updated to reflect the drop. No prob, thus far. But then the
2009 Mar 05
4
before_filter :action_name OR :action_name
Hi there I am wondering if we can use before_filter in the form of :action OR :action what i want to do is to implement one of the actions, if the first failed, then go to the second when i use before_filter :action1 before_filter :action2 each method will run them, my case is that i want to check if one of them is true and not both any idea?
2006 Apr 10
3
form_remote_tag can only have one submit button?
I setup a form_remote_tag with several submit buttons, all of them share the same name ( ''do_action'' ) and their values differ. eg. button1 named do_action with value ACTION1 button2 named do_action with value ACTION2, etc No matter which button I press the value passed is always the one defined for the first of these buttons ( the correct value associated with the pressed
2004 Jan 21
2
[Fwd: Re: Comboot Menu]
Thanks for the comment. The next pass for a file format ... ------ FILE BEGINS ----- # Comment lines [menu] item="text to display" status="status line text" action= SUBMENU | INACTIVE | whatever submenu= <number> data="arbitrary string" item="text to display" status="status line text" action= SUBMENU | INACTIVE | RUN | EXIT submenu=
2006 Jul 02
3
2 before_filters, only want one to render something
I have two before_filters for a few of my controllers. They are running my own methods authorize and admin_authorize. authorize is called on just about every action to make sure that a user is logged in. admin_authorize is called on about 80% of the actions and is used to make sure that a user is an administrator. If a user tries to access an admin_authorize protected action without being
2006 Jul 11
1
Aggregate Controllers
Hi, I''m developing a dashboard like page and basically want to combine the result of multiple actions on a page. I''ve done this so far: def index r1 = render_to_string :action => "action1" r2 = render_to_string :action => "action2" render :text => r1+r2 end This works, but now I want to render from other controllers and this is where
2006 Apr 03
1
Best way to set custom Controller options
Hi All! I''m searching a good way to set some options in my Controllers; I tried defining a custom function, ie: class PeopleController < ApplicationController set_my_actions :action1, :action2 end class ApplicationController def self.set_my_actions(*args) @@my_actions = args end end But ''@@my_actions'' sets the class variable to _every_
2006 Jul 26
5
Restricting before_filter to certain actions?
Can you restric before_filter to specific actions? -- Posted via http://www.ruby-forum.com/.
2005 Dec 20
3
Single controller to browse things in categories
First off, hi, I''m [obviously] new :O) Please excuse my question as I''m sure it''s been answered, but I can''t find it anywhere. I have a table of categories: id name 1 Foo 2 Bar I have things which belong_to categories: id category_id subject date 1 1 my subject 07/09/2004 and Further classifications which belong_to categories: id category_id name 1 1 More
2006 Jul 07
5
Can a route require POST or GET? / REST problem with routing
Hi, A store front a customer wants to GET /product/5/show. But for the application this is really GET /cart_item/new/5 or even better /cart_item/new?cart_item[product_id]=5 When the customer clicks add_to_cart they POST /product/5/show so that the url doesn''t confuse the user when any validation errors occur. But for the applicaiton this should be POST
2009 Jan 08
4
Problem with disable_with
Hi Group, I have a registration.html.erb page with the following JavaScript at the top which I use to validate form fields: <script type="text/javascript"> <!-- function validate(){ if ((document.myForm.email_projectname.value=="")|| (document.myForm.email_projecttype_id.selectedIndex<1)|| (document.myForm.email_region_id.selectedIndex<1)) { alert
2006 Apr 24
3
TimeStamp conversion
Hi, I''ve got a TimeStamp field in MySql and want to use the hour and minutes in the value. for example: StartTime = Schedule.find(action2.ScheduleID).DateTimeStart.to_s That returns "Mon Feb 20 08:00:00 Romance Standard Time 2006" How do I get 08:00 returned ?? Thanks ! Steven. -- Posted via http://www.ruby-forum.com/.
2008 Mar 10
5
Passing extra parameters to functions called from Observers
Hi again, When you have an ''obeserver'' setup as follows: $(''myForm'').observe(''submit'', validateForm); If a user submits the form the ''validateForm'' function is called and is automagically passed the ''event'' to work with. This is fantastic! But is there a way to pass another argument to the function?
2006 Apr 24
4
javascript in RoR page - Check ALL/uncheck ALL buttons
I am trying to implement a check all and uncheck all button for my check boxes. Here is what I have below. I am getting this error each time: Error: document.myform.add_visit_for_this_Pt has no properties Source File: http://localhost:3000/AddPatientVisit/addvisits Line: 1 Strange that I can''t seem to pass value into the function. Thanks for your help! <SCRIPT
2013 Apr 05
2
model.frame: object is not a matrix
Over a decade ago there was a problem with model.frame when the variable names were long: https://stat.ethz.ch/pipermail/r-help/2002-August/024492.html I have similar symptoms with R 2.15.3 on Windows 7: Browse[2]> x <- model.matrix(formula(myform), p$data) Error in model.frame.default(object, data, xlev = xlev) (from mice.R#601) : object is not a matrix My attempt at a work-around
2018 May 01
4
issue with model.frame()
A user sent me an example where coxph fails, and the root of the failure is a case where names(mf) is not equal to the term.labels attribute of the formula -- the latter has an extraneous newline. Here is an example that does not use the survival library. # first create a data set with many long names n <- 30? # number of rows for the dummy data set vname <- vector("character",
2011 Jan 23
2
Passing in arguments into function
Hi, I had a function that looked like: diff <- lm(x ~ y + z) How can I pass the argument to the 'lm' function on the fly? E.g., if I pass it in as a string (e.g. "x ~ y + z"), then the lm function treats it as a string and not a proper argument. many thanks [[alternative HTML version deleted]]
2010 Mar 05
1
How to parse the arguments from a function call and evaluate them in a dataframe?
Hi, I would like to write a function which has the following syntax: myfn <- function(formula, ftime, fstatus, data) { # step 1: obtain terms in `formula' from dataframe `data' # step 2: obtain ftime from `data' # step 3: obtain fstatus from `data' # step 4: do model estimation # step 5: return results } The user would call this function as: myfn(formula=myform,