Q:

If params is present not working

My url paths are this 
/locale/country/
/locale/country/region/

models: 
class Region
belongs: country
end

class Country
has_many: regions
end

a foreign-key country_id in regions table
This is a part of a nav partial in the layout file. 
//block region
    - if params[:region].present?  
       %ul.thumbnails
       - @region.tags.find_each(:conditions => "active_house = true") do |a|
          %li.span2
          .thumbnail
            - a.attachments.limit(1).each do |b|
              = image_tag(b.file.url)
            .caption
              %p 
                #{link_to a.h1, tag_country_region_houses_path(@country, @region, a.name), :class => 'btn-nav', class: active_class?(tag_houses_path(a.name))} 
//block country    
    - else
        %ul.thumbnails
        - @country.tags.find_each(:conditions => "active_house = true") do |a|
           %li.span2
            .thumbnail
              - a.attachments.limit(1).each do |b|
                = image_tag(b.file.url)
             .caption
              %p 
                #{link_to a.h1, tag_country_houses_path(@country,  a.name), :class => 'btn-nav', class: active_class?(tag_houses_path(a.name))}

When the visitor is on the path /local/country i want show block country and when the vistor is on /locale/country/region i want to show block region. 
I thought if params[:region].present?  will do the trick.  But no....how can i realize this?  

A:

Before the line
- if params[:region].present?  

In your view, try ptinting the lines,
- p params[:region]
- p params[:region].present? 

that could give you some clue about the behaviour.