[Nitro] nitro 0.40.0 changes?

transfire at gmail.com transfire at gmail.com
Thu Nov 16 22:10:33 EST 2006

Matt Rose wrote:
> Sorry to be a bother about this guys, but now I'm getting an error
> message.  I kind of suspected this would happen, because of the params.
> How did we decide parameters would be called now in the action now?
> I have a setup page that takes form input, and passes it as GET
> params back to the same page.  When I pass it no params, it works
> great, but when I try and pass it params via a GET request, I get this:
> http://localhost:9000/setup?title=masterblog&desc=master
> +blog&user=matt&pass=pass
> Path: /setup
> Wrong parameter count for setup().
> the setup function in the controller looks like this:
> def setup
>      p request.params
>      blogs = Blog.all
>      p @blogs
>      #should only be able to go here when there's nothing setup
>      if request.params.empty? && Master.all.empty?
>        @render_master_form = true
>      end
>      if request.params.values.length == 4 && Master.all.empty?
>        Master.create(*request.params.values)
>      end
>      p Master.find_one
>      @master = Master.find_one
>      if request.params.length == 2
>        Blog.create(*request.params.values)
>      end
>    end

I think that there was a move toward "meta-handling" the parameters.
Try adding arguments to setup method rather then using request.params.
I'm not certain about it but maybe one of these will work?

  def setup( title, desc )
  def setup( params )
  def setup( *params )

Again I could be comepletely wrong about this but I'm making a
guestimation based on recent conversations and the error you got.


More information about the Nitro-general mailing list