[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread frankjmat...@gmail.com
> No. It has *nothing* to do with appearance. PUT is for updating an > existing resource (generally through a form). and i am updating a resource... i'm not using #update_attributes, but in my controller I am saving. > I think that the need for a PUT link does not exist, period. If your > app

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread Marnen Laibow-Koser
frankjmat...@gmail.com wrote: >> >> In any case, the arguments are whatever is defined in that particular >> >> route. Run rake routes or look at your routes file to see what that >> >> would be. >> >> > That doesn't make any sense. >> >> Whether it makes sense or not, it is the case. :) �The argum

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread frankjmat...@gmail.com
> >> In any case, the arguments are whatever is defined in that particular > >> route. Run rake routes or look at your routes file to see what that > >> would be. > > > That doesn't make any sense. > > Whether it makes sense or not, it is the case. :)  The arguments are the > :parameters in the rou

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread Marnen Laibow-Koser
frankjmat...@gmail.com wrote: [...] >> In any case, the arguments are whatever is defined in that particular >> route. �Run rake routes or look at your routes file to see what that >> would be. > > That doesn't make any sense. Whether it makes sense or not, it is the case. :) The arguments are t

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread frankjmat...@gmail.com
On May 19, 11:29 am, Marnen Laibow-Koser wrote: > frankjmat...@gmail.com wrote: > > yeah, i've read it half a dozen times > > Read *what*?  Please quote when replying so it's clear what you're > responding to. I have read the rails routing guide a dozen times. > > - doesn't give me any insight o

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread Marnen Laibow-Koser
frankjmat...@gmail.com wrote: > yeah, i've read it half a dozen times Read *what*? Please quote when replying so it's clear what you're responding to. > - doesn't give me any insight on > the argument list for the _path family of functions and apidock is > less than helpful as well. Are you ta

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread frankjmat...@gmail.com
yeah, i've read it half a dozen times - doesn't give me any insight on the argument list for the _path family of functions and apidock is less than helpful as well. searching through google led to some obscure blog that said i could do: link_to 'do something', station_path(@station, :station =>

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-19 Thread Marnen Laibow-Koser
frankjmat...@gmail.com wrote: > where can i find the documentation for all of the > action_controller_path functions? > > multiple submits on a form are no longer a viable solution because the > only way to tell which one was hit was to know the name "value" of the > submit button.. when its in di

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
where can i find the documentation for all of the action_controller_path functions? multiple submits on a form are no longer a viable solution because the only way to tell which one was hit was to know the name "value" of the submit button.. when its in different languages it gets ugly.. im just g

Re: [Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread Hassan Schroeder
On Tue, May 18, 2010 at 12:49 PM, frankjmat...@gmail.com wrote: > so i can have a form submit to update, have the submit buttons have > different values and then in the update action figure out which one > was clicked? Exactly. > what is necessary beyond f.submit in my view? Just create multipl

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
so i can have a form submit to update, have the submit buttons have different values and then in the update action figure out which one was clicked? what is necessary beyond f.submit in my view? thanks, - FJM On May 18, 3:40 pm, Hassan Schroeder wrote: > >> i want these buttons to located inside

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
from what i've read - buttons are not the way to go... links are. now with that in mind... yes - the 20 states was a contrived example just to illustrate how absurd it could become. and no matter what i do im sure time will show me better ways to refactor.. i just want to have a somewhat stable st

Re: [Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread Hassan Schroeder
>> i want these buttons to located inside of my form - and while ive >> never tried it, i'll assume that nesting forms leads to ... > It leads to invalid HTML and unpredictable results. > > But do these have to be submit buttons?  Why not make them links? But a form can have multiple submit butto

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread Marnen Laibow-Koser
[Please quote when replying, so that it is clear what you are responding to.] frankjmat...@gmail.com wrote: > a form can only direct to one action though, correct? Absent JavaScript, yes. > > i want these buttons to located inside of my form - and while ive > never tried it, i'll assume that n

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
a form can only direct to one action though, correct? i want these buttons to located inside of my form - and while ive never tried it, i'll assume that nesting forms leads to heartbreak and homelessness... if i have 20 different states... and am only going to need a user to chose 1 of 3 at any g

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread Marnen Laibow-Koser
frankjmat...@gmail.com wrote: > i'll try another example, maybe it'll be a little clearer - also, ill > take SM out of the equation. > > > suppose theres a job edit page... the page has all the job attributes, > title, description... etc. but i dont want to change those. i want a > button somewhe

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
i'll try another example, maybe it'll be a little clearer - also, ill take SM out of the equation. suppose theres a job edit page... the page has all the job attributes, title, description... etc. but i dont want to change those. i want a button somewhere in the form called "mark & dupe".. what t

Re: [Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread Colin Law
On 18 May 2010 17:06, frankjmat...@gmail.com wrote: > i suppose state_machine was a bad example to start with (but is my > current situation so it was unavoidable)... > > the example you pointed me to involved changing a collection_select > and clicking the save button... > > i want to instead dis

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread frankjmat...@gmail.com
i suppose state_machine was a bad example to start with (but is my current situation so it was unavoidable)... the example you pointed me to involved changing a collection_select and clicking the save button... i want to instead display different buttons (or links) depending on a users roles and

[Rails] Re: staying RESTful and triggering actions without saving a record.

2010-05-18 Thread Aaron Pfeifer
Hey Frank, state_machine actually provides support for executing events using a standard REST interface. Rather than calling the event method directly (such as "release!"), you can set an the machine's event attribute like so: station.state_event = 'release' station.save! Any event that get