Sha256: 2ef8ccc9d00a5f9c3622b35404359e561d477c36f220e1e9fc06121539442a73

Contents?: true

Size: 866 Bytes

Versions: 10

Compression:

Stored size: 866 Bytes

Contents

class ViewWithPartial < Garterbelt::View
  needs :user

  def content
    div :class => "user_status" do
      ul do
        if user.upgradeable?
          li do
            a 'upgrade', :href => "#", :class => 'upgrade_link'
          end
        else
          li "pro", :class => 'pro', :title => "You're a real pro."
        end
        
        li do
          partial SettingLink, :user => user
        end
        
        li :class => 'last' do
          a "logout", :href => "/logout", :title => "Get out of here!", :class => 'logout_link'
        end
      end
    end
  end
  
end

class SettingLink < Garterbelt::View
  needs :user
  
  def content
    a 'settings', :href => "/user/#{user.id}?selected=settings",
      :id => "settings_link",
      :title => "Reset your name or password, upload your photo, or adjust your email notifications"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
garterbelt-0.1.1 spec/integration/templates/view_with_partial.rb
garterbelt-0.1.0 spec/integration/templates/view_with_partial.rb
garterbelt-0.0.9 spec/integration/templates/view_with_partial.rb
garterbelt-0.0.8 spec/integration/templates/view_with_partial.rb
garterbelt-0.0.7 spec/integration/templates/view_with_partial.rb
garterbelt-0.0.6 spec/integration/templates/view_with_partial.rb
garterbelt-0.0.5 spec/integration/templates/view_with_partial.rb
garterbelt-0.0.4 spec/integration/templates/view_with_partial.rb
garterbelt-0.0.3 spec/integration/templates/view_with_partial.rb
garterbelt-0.0.2 spec/integration/templates/view_with_partial.rb