Google Groups Home
Help | Sign in
locals and partials
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
liku  
View profile
 More options 21 Jun 2008, 13:43
From: liku <lfan...@gmail.com>
Date: Sat, 21 Jun 2008 05:43:17 -0700 (PDT)
Local: Sat 21 Jun 2008 13:43
Subject: locals and partials
hi there,
I'm trying to get partials with locals working. but somehow I am too
stupid to implement it...
i followed the exact instructions on the staticmatic-website:

this in my current file:
= partial('mypartial', :locals => { :title => 'My Title' })

than this under partials/mypartial.haml:
%h1 title

=> this always prints out "title" (and not "My Title")

i even tried:

%h1= title or %h1= @title, which seems to make more sense to me, but
still no luck.

haml (2.0.0)
staticmatic (0.9.4)

any pointers???

thanks a bunch!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan McGeary  
View profile
 More options 21 Jun 2008, 15:04
From: "Ryan McGeary" <ryan.mcge...@gmail.com>
Date: Sat, 21 Jun 2008 10:04:32 -0400
Local: Sat 21 Jun 2008 15:04
Subject: Re: locals and partials

After trying your scenario, I found that there seems to be a problem with
staticmatic 0.9.4, haml 2.0.0, and using partials.  Try this:
$ sudo gem uninstall staticmatic
$ sudo gem install -v0.9.3 staticmatic
$ sudo gem install -v1.8.2 haml
$ sudo gem uninstall -v2.0.0 haml

This will leave you with staticmatic 0.9.3 and haml 1.8.2, which should
allow your scenario to work:

some_page.haml:
= partial("mypartial", :locals => { :title => "My Title" })

mypartial.haml:
%h1= title

I haven't yet investigated why the conflict between staticmatic 0.9.4 and
haml 2.0.0 exists, even though staticmatic 0.9.4 is dependent on haml >=
2.0.0.

-Ryan


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Lumenta  
View profile
 More options 21 Jun 2008, 15:41
From: Stephen Lumenta <lfan...@gmail.com>
Date: Sat, 21 Jun 2008 16:41:31 +0200
Local: Sat 21 Jun 2008 15:41
Subject: Re: locals and partials

thanks for checking it out, it works now.
I get a new error though, which might clarify my previous problems.

DEPRECATION WARNING:
The Haml :locals option is deprecated and will be removed in version  
2.0.
Use the locals option for Haml::Engine#render instead.

thanks!

Am 21.06.2008 um 16:04 schrieb Ryan McGeary:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan McGeary  
View profile
 More options 21 Jun 2008, 19:15
From: "Ryan McGeary" <ryan.mcge...@gmail.com>
Date: Sat, 21 Jun 2008 14:15:46 -0400
Local: Sat 21 Jun 2008 19:15
Subject: Re: locals and partials

Stephen,
Just ignore that warning for now.  I think that's caused by that version of
staticmatic using a deprecated feature of Haml.  It doesn't affect anything.

-Ryan


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan McGeary  
View profile
 More options 21 Jun 2008, 19:18
From: "Ryan McGeary" <ryan.mcge...@gmail.com>
Date: Sat, 21 Jun 2008 14:18:08 -0400
Local: Sat 21 Jun 2008 19:18
Subject: Re: locals and partials

Just re-read what you wrote:

> I get a new error though, which might clarify my previous problems.

Yes, quite likely if staticmatic 0.9.4 is still using that same feature on
haml 2.0 and haml 2.0 removed the deprecated feature.

-Ryan

On Sat, Jun 21, 2008 at 2:15 PM, Ryan McGeary <ryan.mcge...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google