From micron at bglug.it Thu May 8 08:27:44 2008 From: micron at bglug.it (Flavio Castelli) Date: Thu, 8 May 2008 14:27:44 +0200 Subject: [Cells-talk] NoMethodError protect_against_forgery? Message-ID: <200805081427.45068.micron@bglug.it> Hi, I'm using Cells from trunk under rails 2.0.2 and I get this error. I've tried to add this method inside my custom cell: def protect_against_forgery? return true end But I'm still facing the problem. Any hint? Cheers Flavio From paul at pauldix.net Thu May 8 09:35:36 2008 From: paul at pauldix.net (Paul Dix) Date: Thu, 8 May 2008 09:35:36 -0400 Subject: [Cells-talk] NoMethodError protect_against_forgery? In-Reply-To: <200805081427.45068.micron@bglug.it> References: <200805081427.45068.micron@bglug.it> Message-ID: the following is probably what you're looking for: http://mikepence.wordpress.com/2008/04/09/cells-and-rails-20-request-forgery-protection/ Best, Paul On Thu, May 8, 2008 at 8:27 AM, Flavio Castelli wrote: > Hi, I'm using Cells from trunk under rails 2.0.2 and I get this error. > > I've tried to add this method inside my custom cell: > def protect_against_forgery? > return true > end > > But I'm still facing the problem. > > Any hint? > > Cheers > Flavio > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > From mike.pence at gmail.com Thu May 8 09:55:10 2008 From: mike.pence at gmail.com (Mike Pence) Date: Thu, 8 May 2008 09:55:10 -0400 Subject: [Cells-talk] NoMethodError protect_against_forgery? In-Reply-To: References: <200805081427.45068.micron@bglug.it> Message-ID: If that does not fix your problem, let me know. On Thu, May 8, 2008 at 9:35 AM, Paul Dix wrote: > the following is probably what you're looking for: > > http://mikepence.wordpress.com/2008/04/09/cells-and-rails-20-request-forgery-protection/ > > Best, > Paul > > On Thu, May 8, 2008 at 8:27 AM, Flavio Castelli wrote: > > Hi, I'm using Cells from trunk under rails 2.0.2 and I get this error. > > > > I've tried to add this method inside my custom cell: > > def protect_against_forgery? > > return true > > end > > > > But I'm still facing the problem. > > > > Any hint? > > > > Cheers > > Flavio > > _______________________________________________ > > Cells-talk mailing list > > Cells-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/cells-talk > > > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From micron at bglug.it Thu May 8 10:14:25 2008 From: micron at bglug.it (Flavio Castelli) Date: Thu, 8 May 2008 16:14:25 +0200 Subject: [Cells-talk] NoMethodError protect_against_forgery? In-Reply-To: References: <200805081427.45068.micron@bglug.it> Message-ID: <200805081614.25747.micron@bglug.it> On Thursday 08 May 2008 15:55:10 Mike Pence wrote: > If that does not fix your problem, let me know. this problem seems fixed, thank you very much (many thanks also to Paul)! Now I've to solve another one (this time there's something wrong in my code) Cheers Flavio From micron at bglug.it Thu May 8 12:00:07 2008 From: micron at bglug.it (Flavio Castelli) Date: Thu, 8 May 2008 18:00:07 +0200 Subject: [Cells-talk] Can I do it using cells? Message-ID: <200805081800.07354.micron@bglug.it> Ok, this is what I would like to do. I've created an action inside a controller that shows a table like this one [1] (I've followed this tutorial [2]). I would like to display this table also in another view (for being precise on the site's main page). So I've created a Cell with a "list" action where I've copied the code of my previous controller. Then I've copied my old view to the cell's one and I've done other small adjustments. Then I've added the following code inside my main page view: <%= render_cell :test, :list %> I've opened the web page and I've faced these problems: - protect against forgery error: solved (thanks guys) - all the helpers declared in the "application_helper" file are not find: I've temporary removed all references inside my cell - the partial file used by my view wasn't found: I've moved its code straight into the view (I can accept this solution) - the ajax filtering control doesn't work, it's unable to find the list method What do you think, can Cells help me or I've to duplicate my code? Cheers Flavio [1] http://dev.nozav.org/ajaxtable/ [2] http://dev.nozav.org/rails_ajax_table.html From mike.pence at gmail.com Thu May 8 12:17:26 2008 From: mike.pence at gmail.com (Mike Pence) Date: Thu, 8 May 2008 12:17:26 -0400 Subject: [Cells-talk] Can I do it using cells? In-Reply-To: <200805081800.07354.micron@bglug.it> References: <200805081800.07354.micron@bglug.it> Message-ID: To use the application helper, you need to add: helper :application to the top of your Cells controller. You need to fully qualify the path the partial in your render partial call. So, if your partial is called "_foo" and it lives in the "bar" views folder, you need to say render :partial => "bar/foo" dropping the leading _ in the partial name, and including the view subfolder name. Since you are using Ajax with your Cell, you are going to have to create a regular old Rails controller to handle those requests and delegate them to the cell, since cell controllers are not exposed to the browser. HTH, Mike On Thu, May 8, 2008 at 12:00 PM, Flavio Castelli wrote: > Ok, this is what I would like to do. > I've created an action inside a controller that shows a table like this > one > [1] (I've followed this tutorial [2]). > > I would like to display this table also in another view (for being precise > on > the site's main page). > > So I've created a Cell with a "list" action where I've copied the code of > my > previous controller. Then I've copied my old view to the cell's one and > I've > done other small adjustments. > > Then I've added the following code inside my main page view: > <%= render_cell :test, :list %> > > I've opened the web page and I've faced these problems: > - protect against forgery error: solved (thanks guys) > - all the helpers declared in the "application_helper" file are not find: > I've > temporary removed all references inside my cell > - the partial file used by my view wasn't found: I've moved its code > straight > into the view (I can accept this solution) > - the ajax filtering control doesn't work, it's unable to find the list > method > > What do you think, can Cells help me or I've to duplicate my code? > > Cheers > Flavio > > [1] http://dev.nozav.org/ajaxtable/ > [2] http://dev.nozav.org/rails_ajax_table.html > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apotonick at gmail.com Wed May 14 09:33:38 2008 From: apotonick at gmail.com (Nick Sutterer) Date: Wed, 14 May 2008 15:33:38 +0200 Subject: [Cells-talk] Can I do it using cells? In-Reply-To: References: <200805081800.07354.micron@bglug.it> Message-ID: ciao flavio, i'd love to hear if mike tips were ok for you (so i can compile them in a long-awaited faq). do you need further help? cheers, nick On Thu, May 8, 2008 at 6:17 PM, Mike Pence wrote: > To use the application helper, you need to add: > > helper :application > > to the top of your Cells controller. > > You need to fully qualify the path the partial in your render partial call. > So, if your partial is called "_foo" and it lives in the "bar" views folder, > you need to say > > render :partial => "bar/foo" > > dropping the leading _ in the partial name, and including the view subfolder > name. > > Since you are using Ajax with your Cell, you are going to have to create a > regular old Rails controller to handle those requests and delegate them to > the cell, since cell controllers are not exposed to the browser. > > HTH, > Mike > > > > On Thu, May 8, 2008 at 12:00 PM, Flavio Castelli wrote: >> >> Ok, this is what I would like to do. >> I've created an action inside a controller that shows a table like this >> one >> [1] (I've followed this tutorial [2]). >> >> I would like to display this table also in another view (for being precise >> on >> the site's main page). >> >> So I've created a Cell with a "list" action where I've copied the code of >> my >> previous controller. Then I've copied my old view to the cell's one and >> I've >> done other small adjustments. >> >> Then I've added the following code inside my main page view: >> <%= render_cell :test, :list %> >> >> I've opened the web page and I've faced these problems: >> - protect against forgery error: solved (thanks guys) >> - all the helpers declared in the "application_helper" file are not find: >> I've >> temporary removed all references inside my cell >> - the partial file used by my view wasn't found: I've moved its code >> straight >> into the view (I can accept this solution) >> - the ajax filtering control doesn't work, it's unable to find the list >> method >> >> What do you think, can Cells help me or I've to duplicate my code? >> >> Cheers >> Flavio >> >> [1] http://dev.nozav.org/ajaxtable/ >> [2] http://dev.nozav.org/rails_ajax_table.html >> _______________________________________________ >> Cells-talk mailing list >> Cells-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/cells-talk > > > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > > From apotonick at gmail.com Wed May 14 10:12:46 2008 From: apotonick at gmail.com (Nick Sutterer) Date: Wed, 14 May 2008 16:12:46 +0200 Subject: [Cells-talk] interview about cells Message-ID: hey folks, an interview about cells appeared on infoq: http://www.infoq.com/news/2008/05/cells-components-for-rails thanks for your support, cheers, nick From micron at bglug.it Thu May 15 10:06:07 2008 From: micron at bglug.it (Flavio Castelli) Date: Thu, 15 May 2008 16:06:07 +0200 Subject: [Cells-talk] Can I do it using cells? In-Reply-To: References: <200805081800.07354.micron@bglug.it> Message-ID: <200805151606.07833.micron@bglug.it> On Thursday 08 May 2008 18:17:26 Mike Pence wrote: > To use the application helper, you need to add: > > helper :application > > to the top of your Cells controller. thanks, it worked > You need to fully qualify the path the partial in your render partial call. > So, if your partial is called "_foo" and it lives in the "bar" views > folder, you need to say > > render :partial => "bar/foo" > > dropping the leading _ in the partial name, and including the view > subfolder name. I haven't yet tried > Since you are using Ajax with your Cell, you are going to have to create a > regular old Rails controller to handle those requests and delegate them to > the cell, since cell controllers are not exposed to the browser. it works! Thanks for the help! Cheers Flavio From micron at bglug.it Thu May 15 10:07:57 2008 From: micron at bglug.it (Flavio Castelli) Date: Thu, 15 May 2008 16:07:57 +0200 Subject: [Cells-talk] Can I do it using cells? In-Reply-To: References: <200805081800.07354.micron@bglug.it> Message-ID: <200805151607.57337.micron@bglug.it> On Wednesday 14 May 2008 15:33:38 Nick Sutterer wrote: > i'd love to hear if mike tips were ok for you (so i can compile them > in a long-awaited faq). > do you need further help? Excuse me for the delay but I was busy with other work. I've just sent an email to the ml. Thanks for your willingness Flavio