[Nitro] nitro 0.40.0 changes?

Matt Rose mattrose at folkwolf.net
Thu Nov 16 22:30:13 EST 2006


On 16-Nov-06, at 10:10 PM, transfire at gmail.com wrote:

>
> 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.
>

Well, this is interesting, I changed the setup method to setup 
(params) and now I get this error message:

Wrong parameter count for setup(masterblog, master blog).

when passing in the same get string, which means it seems to be  
reading only the first two params.

Now I'm really stumped.



> T.
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general



More information about the Nitro-general mailing list