Yes you are right I forgot to check if the other values are not nil.

Thank you!

Just another question with my webservice. I am using Savon for my SOAP
requests and the output is a XML or a very big hash made out of the
XML. That means it is a XML or hash with a lot of different tags and
it is getting very deep, if that is the right word.

XML:

<First_Layer>
  <Second_Layer>
    <Third_Layer>
       Text that I want to get
    </Third_Layer>
  </Second_Layer>
</First_Layer>

hash:

{First_Layer => {Second_Layer => {Third_Layer => "Text that I want to
get"}}}


What is the easiest way to get out the information I want. Right now I
use the hash at use things like that:

puts resultarray[":First_Layer"][":Second_Layer"]["Third_Layer"]

That means a lot of code.

Thanks in advance
Sebastan


On 15 Mrz., 16:10, Michael Pavling <[email protected]> wrote:
> On 15 March 2011 15:02, Sebastian <[email protected]> wrote:
>
> > My controller is looking this:
>
> >  def index
> >    @var1 = Mywebservice.new(params[:value1], params[:value1],
> > params[:value1]) if params[:value1]
> >  end
>
> Don't you mean :
> @var1 = Mywebservice.new(params[:value1], params[:value2],
> params[:value3]) if params[:value1] && params[:value2] && params[:value3]
>
> In your code, you're not access value2 or value3...
>
> > I don't know if my code is beautiful, but it is working!!
>
> It may not be beautiful, but working is the important thing - beauty
> is a bonus! :-)

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to