Just a couple of days ago i thought i read something in "the latest changes" for rails 0.11 that had to do with some change in accessing @params that was supposed to mamke things easier. When i went back to look for it, though, i searched and searched and found nothing. Was i hallucinating... or just so misunderstood what i read that i couldn''t find what i thought i "remembered". Does this ring any bell with anyone (link?) craig
On Thu, 31 Mar 2005 00:18:53 -0500, craig duncan <craig-duncan-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org> wrote:> Just a couple of days ago i thought i read something in "the latest changes" for > rails 0.11 that had to do with some change in accessing @params that was supposed to > mamke things easier. When i went back to look for it, though, i searched and > searched and found nothing. Was i hallucinating... or just so misunderstood what i > read that i couldn''t find what i thought i "remembered". Does this ring any bell > with anyone (link?)Hi Craig, It was a change to ActionWebService. Instead of using @params/@method_params, to access parameters to a web service method, one would just declare a method as per normal. In other words, instead of this, in a "direct dispatching" controller: def my_webservice_method @params[''param1''] + @params[''param2''] end You''d just do it how you do it everywhere: def my_webservice_method(param1, param2) param1 + param2 end I think the reason for this change is self-evident :) Web service methods are not actions (going to /controller/my_webservice_method in a browser will not work), so there was no point in trying to pretend they were just because of previous convention. In addtion, web service methods are now automatically "hidden" if they''re in implemented in controllers, in that accessing /controller/my_webservice_method will yield a standard "No action responded to my_webservice_method" instead of the previous "Internal protocol error". Hope this clears it up, Leon
leon breedt wrote:> It was a change to ActionWebService. Instead of using > @params/@method_params, to access parameters to a web service method, > one would just declare a method as per normal. > > In other words, instead of this, in a "direct dispatching" controller: > > def my_webservice_method > @params[''param1''] + @params[''param2''] > end > > You''d just do it how you do it everywhere: > > def my_webservice_method(param1, param2) > param1 + param2 > end > > > I think the reason for this change is self-evident :) > > Web service methods are not actions (going to > /controller/my_webservice_method in a browser will not work), so there > was no point in trying to pretend they were just because of previous > convention. > > In addtion, web service methods are now automatically "hidden" if > they''re in implemented in controllers, in that accessing > /controller/my_webservice_method will yield a standard "No action > responded to my_webservice_method" instead of the previous "Internal > protocol error". > > Hope this clears it up, > LeonYes... thanks much. I didn''t get exactly what i was reading about when i scanned it the first time but your explanation puts it into context. craig