<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-4937488729022245645.post8638149389934319475..comments</id><updated>2008-07-16T17:28:05.771-05:00</updated><title type='text'>Comments on Stochastic Bytes: param_accessible</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.stochasticbytes.com/feeds/8638149389934319475/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4937488729022245645/8638149389934319475/comments/default'/><link rel='alternate' type='text/html' href='http://blog.stochasticbytes.com/2008/03/paramaccessible.html'/><author><name>Christopher J. Bottaro</name><uri>http://www.blogger.com/profile/14116593743589959438</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4937488729022245645.post-4806356611403313481</id><published>2008-07-16T17:28:00.000-05:00</published><updated>2008-07-16T17:28:00.000-05:00</updated><title type='text'>Heh, yeah... the plugin just plain wasn't working ...</title><content type='html'>Heh, yeah... the plugin just plain wasn't working in a real app, even though all the tests were passing.&lt;BR/&gt;&lt;BR/&gt;I rewrote the entire plugin and tests, as well as tested in a real app.  Should be good to go now.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4937488729022245645/8638149389934319475/comments/default/4806356611403313481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4937488729022245645/8638149389934319475/comments/default/4806356611403313481'/><link rel='alternate' type='text/html' href='http://blog.stochasticbytes.com/2008/03/paramaccessible.html?showComment=1216247280000#c4806356611403313481' title=''/><author><name>Christopher J. Bottaro</name><uri>http://www.blogger.com/profile/14116593743589959438</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='17459206204540304686'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.stochasticbytes.com/2008/03/paramaccessible.html' ref='tag:blogger.com,1999:blog-4937488729022245645.post-8638149389934319475' source='http://www.blogger.com/feeds/4937488729022245645/posts/default/8638149389934319475' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-4937488729022245645.post-2662438435397743467</id><published>2008-07-16T12:31:00.000-05:00</published><updated>2008-07-16T12:31:00.000-05:00</updated><title type='text'>Hi ChristopherI'm having a time getting this to wo...</title><content type='html'>Hi Christopher&lt;BR/&gt;&lt;BR/&gt;I'm having a time getting this to work, even on a new test app:&lt;BR/&gt;&lt;BR/&gt;rails test_app; cd test_app; ./script/generate controller home; ./script/plugin install git://github.com/cjbottaro/param_protected.git&lt;BR/&gt;&lt;BR/&gt;then in app/controllers/home.rb&lt;BR/&gt;&lt;BR/&gt;  param_protected :name&lt;BR/&gt;&lt;BR/&gt;  def index&lt;BR/&gt;    render :text =&gt; "Hello %s" % param[:name]&lt;BR/&gt;  end&lt;BR/&gt;&lt;BR/&gt;&lt;BR/&gt;Hitting http://localhost:3000/home?name=mina shows this in the browser:&lt;BR/&gt;Hello mina&lt;BR/&gt;&lt;BR/&gt;Logging indicates that "name" was not protected:&lt;BR/&gt;Processing HomeController#index (for 127.0.0.1 at 2008-07-16 13:27:04) [GET]&lt;BR/&gt;  Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo&lt;BR/&gt;SGFzaHsABjoKQHVzZWR7AA==--2b265f2ec8b10c2c878a44bd512a2012e8148e7e&lt;BR/&gt;  Parameters: {"name"=&gt;"mina", "action"=&gt;"index", "controller"=&gt;"home"}&lt;BR/&gt;  Parameters protected: {}&lt;BR/&gt;&lt;BR/&gt;Digging through the plugin source, I think the problem is in _pp_get_actions, specifically, calling public_instance_methods&lt;BR/&gt;&lt;BR/&gt;At the time the method in my controller gets called, the "index" method has not yet been defined, so the above code doesn't assign anything to _pp_protected_map&lt;BR/&gt;&lt;BR/&gt;I've tried this with older versions of rails instead of 2.1 and it's the same behavior.&lt;BR/&gt;&lt;BR/&gt;Any ideas ?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4937488729022245645/8638149389934319475/comments/default/2662438435397743467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4937488729022245645/8638149389934319475/comments/default/2662438435397743467'/><link rel='alternate' type='text/html' href='http://blog.stochasticbytes.com/2008/03/paramaccessible.html?showComment=1216229460000#c2662438435397743467' title=''/><author><name>minaguib</name><uri>http://mina.naguib.ca/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.stochasticbytes.com/2008/03/paramaccessible.html' ref='tag:blogger.com,1999:blog-4937488729022245645.post-8638149389934319475' source='http://www.blogger.com/feeds/4937488729022245645/posts/default/8638149389934319475' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-4937488729022245645.post-7726206858880710771</id><published>2008-07-16T08:41:00.000-05:00</published><updated>2008-07-16T08:41:00.000-05:00</updated><title type='text'>Just in time for my current rails project.  Thank ...</title><content type='html'>Just in time for my current rails project.  Thank you :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4937488729022245645/8638149389934319475/comments/default/7726206858880710771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4937488729022245645/8638149389934319475/comments/default/7726206858880710771'/><link rel='alternate' type='text/html' href='http://blog.stochasticbytes.com/2008/03/paramaccessible.html?showComment=1216215660000#c7726206858880710771' title=''/><author><name>minaguib</name><uri>http://mina.naguib.ca/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.stochasticbytes.com/2008/03/paramaccessible.html' ref='tag:blogger.com,1999:blog-4937488729022245645.post-8638149389934319475' source='http://www.blogger.com/feeds/4937488729022245645/posts/default/8638149389934319475' type='text/html'/></entry></feed>