[haml] Re: Haml templates in Rails 3

2012-10-04 Thread Douglas Magnenat
Thanks for these tips on HAML templates.
There is not much about it on the web. So this is precious.


-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/haml/-/t_QL0qc3CtAJ.
To post to this group, send email to haml@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



Re: [haml] Templates

2011-03-21 Thread Mislav Marohnić
On Wed, Mar 16, 2011 at 04:46, andoriyu andor...@gmail.com wrote:


 It there any way to include haml in haml? For example, I have 5 views,
 so all of them have same header and footer, and I don't want to change
 that part in every view, i just want to change it once in one place.


There are many ways to make a rendering system that supports layouts (i.e.
one template that wraps another).

Here is a simple implementation that supports mixed Haml and Erb templates:
https://gist.github.com/879575

It operates with the `yield` keyword like other popular layout
implementations (StaticMatic, Rails, Sinatra).

I wouldn't recommend doing this by hand, however. For static websites I
would definitely suggest StaticMatic like Matija did.

-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



Re: [haml] Templates

2011-03-16 Thread Chris Eppstein
You'll need to use haml in conjunction with a framework for this
functionality. If you just want a static site look into staticmatic, nanoc,
middleman, or one the like.

chris

On Tue, Mar 15, 2011 at 9:46 PM, andoriyu andor...@gmail.com wrote:

 Hello,

 It there any way to include haml in haml? For example, I have 5 views,
 so all of them have same header and footer, and I don't want to change
 that part in every view, i just want to change it once in one place.

 --
 You received this message because you are subscribed to the Google Groups
 Haml group.
 To post to this group, send email to haml@googlegroups.com.
 To unsubscribe from this group, send email to
 haml+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/haml?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



Re: [haml] Templates

2011-03-16 Thread Matija Marohnic
Well, you can use templates for that, which are supported by gems like
staticmatic, sinatra, rails etc. I suggest
staticmatichttp://staticmatic.rubyforge.org/if you want to make
static pages (and I assume you do), it's really awesome.
You can define a single template file which would look something like this:

#header
  !-- something here --

#content
  = yield

#footer
  !-- something else here --

And you would have other sites which are included instead of that =
yieldpart. You'll figure it out :)

On Wed, Mar 16, 2011 at 4:46 AM, andoriyu andor...@gmail.com wrote:

 Hello,

 It there any way to include haml in haml? For example, I have 5 views,
 so all of them have same header and footer, and I don't want to change
 that part in every view, i just want to change it once in one place.

 --
 You received this message because you are subscribed to the Google Groups
 Haml group.
 To post to this group, send email to haml@googlegroups.com.
 To unsubscribe from this group, send email to
 haml+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/haml?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



[haml] Templates

2011-03-15 Thread andoriyu
Hello,

It there any way to include haml in haml? For example, I have 5 views,
so all of them have same header and footer, and I don't want to change
that part in every view, i just want to change it once in one place.

-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



Re: [haml] Can $ rails generate scaffold give me .haml templates in stead of .erb ones?

2010-11-16 Thread Neil Funk
I don't know if there's another way to do this nowadays, but this
works well: http://haml-scaffold.rubyforge.org/

On Mon, Nov 15, 2010 at 6:03 AM, Wojtek Galaj wojtek.ga...@gmail.com wrote:
 Hello everyone.

 I am really sorry if this question has been beaten to death. I tried
 searching the group but could only find a discussion about maybe
 implementing this from way back in 2007.

 So, can I get .haml templates from rails 3.0.1 and not have to rename
 and transcribe everything?

 Thanks in advance,
 Wojtek

 --
 You received this message because you are subscribed to the Google Groups 
 Haml group.
 To post to this group, send email to h...@googlegroups.com.
 To unsubscribe from this group, send email to 
 haml+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/haml?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



[haml] Can $ rails generate scaffold give me .haml templates in stead of .erb ones?

2010-11-15 Thread Wojtek Galaj
Hello everyone.

I am really sorry if this question has been beaten to death. I tried
searching the group but could only find a discussion about maybe
implementing this from way back in 2007.

So, can I get .haml templates from rails 3.0.1 and not have to rename
and transcribe everything?

Thanks in advance,
Wojtek

-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



[haml] Re: Haml templates in Rails 3

2010-11-04 Thread dkuyven
If anyone is interested. Here is the my templates/haml/scaffold/
index.html.haml file
Note: I used tabs instead of double space indenting.

%h1 %= plural_table_name.capitalize %

%table
%tr
% for attribute in attributes -%
%th %= attribute.human_name %
% end -%

%th
%th
%th

- @%= plural_table_name %.each do |%= singular_table_name %|
%tr
% for attribute in attributes -%
%td= %= singular_table_name %.%= attribute.name %
% end -%

%td= link_to 'Show', %= singular_table_name %
%td= link_to 'Edit', edit_%= singular_table_name 
%_path(%=
singular_table_name %)
%td= link_to 'Destroy', %= singular_table_name %, 
:confirm =
'Are you sure?', :method = :delete

%br
= link_to 'New %= human_name %', new_%= singular_table_name %_path


It took some tinkering to get the %th and %td indents to line up
correctly in the output file.

Hope this helps anyone else trying to create their own rails3
templates.

Doug K.

On Nov 4, 9:59 am, dkuyven d...@vencor.ca wrote:
 That link didn't exist, but I did find a few other
 haml_scaffold_generators in github. Tinkering around with them I found
 the haml syntax that I needed. The following syntax worked for my /lib/
 templates/haml/scaffold/new.html.haml file

 -
 %h1 New %= singular_table_name.capitalize %
 = render 'form'
 = link_to 'Back', %= index_helper %_path
 -

 Thanks for the help.

 On Nov 4, 4:30 am, koulikoff koulik...@gmail.com wrote:



 https://github.com/dima4p/rails3_haml_scaffold_generator.git

  On Nov 4, 5:35 am, dkuyven d...@vencor.ca wrote:

   I wish to create a template file which rails g scaffold.. will use
   to create the view files.

   I created a file in /lib/templates/haml/scaffold/new.html.haml and the
   template file is being used, but I'm having trouble figuring out haml
   syntax for the template file.

   Here is the erb template file which I need to convert to a haml
   template file:
   
   h1New %= singular_table_name %/h1

   %%= render 'form' %

   %%= link_to 'Back', %= index_helper %_path %
   

   Can anyone help me with the syntax I need to use to get haml to insert
   the actual singular_table_name  and the index_helper into the
   generated file?

-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



[haml] Re: Haml templates in Rails 3

2010-11-04 Thread dkuyven
If anyone is interested... along the same lines as view templates, I
figured out how to create controller template to override the scaffold
controllers which rails 3 generates.

1. Create the following folders starting at the root folder of your
rails 3 app.

/lib/templates/rails/scaffold_controller

2. Create a controller.rb file inside the 'scaffold_controller'
folder.

3. Paste in the content as found at:

https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb

4. Then modify to suit your needs. In my case I am using
declarative_authorization, and I learned about respond_to and
respond_with from a railscast, so my controller.rb file is reduced to
the following:

-
class %= controller_class_name %Controller  ApplicationController
  filter_resource_access
  respond_to :html, :xml

  def index
@%= plural_table_name % = %= orm_class.all(class_name) %
respond_with (@%= plural_table_name %)
  end

  def show
respond_with (@%= singular_table_name %)
  end

  def new
respond_with (@%= singular_table_name %)
  end

  def edit
  end

  def create
if @%= singular_table_name %.save
  flash[:notice] = '%= human_name % was successfully created.'
end
respond_with(@%= singular_table_name %, :location = %=
plural_table_name %_url)
  end

  def update
if @%= singular_table_name %.update_attributes(params[:%=
singular_table_name %])
  flash[:notice] = '%= human_name % was successfully updated.'
end
respond_with(@%= singular_table_name %, :location = %=
plural_table_name %_url)
  end

  def destroy
@%= singular_table_name %.destroy
respond_with(@%= singular_table_name %, :location = %=
plural_table_name %_url)
  end

end
-

HTH - Doug K.

-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



[haml] Haml templates in Rails 3

2010-11-03 Thread dkuyven
I wish to create a template file which rails g scaffold.. will use
to create the view files.

I created a file in /lib/templates/haml/scaffold/new.html.haml and the
template file is being used, but I'm having trouble figuring out haml
syntax for the template file.

Here is the erb template file which I need to convert to a haml
template file:

h1New %= singular_table_name %/h1

%%= render 'form' %

%%= link_to 'Back', %= index_helper %_path %


Can anyone help me with the syntax I need to use to get haml to insert
the actual singular_table_name  and the index_helper into the
generated file?


-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



[haml] Re: Rails not rendering Haml templates

2010-01-08 Thread Iļja Ketris

I am having the same issue.

Installed HAML:

haml (2.2.16, 2.2.15, 2.2.9, 2.2.3)
haml-edge (2.3.100, 2.3.99, 2.3.60, 2.3.27)

Renamed a template:

i...@shirma:~/Z/shakodat$ ls -l app/views/authors/
total 16
-rwxrwxrw- 1 ike ike 517 2009-07-25 15:00 edit.html.erb
-rwxr-xr-- 1 ike ike 870 2010-01-08 15:51 index.html.haml
-rwxrwxrw- 1 ike ike 411 2009-07-25 12:51 new.html.erb
-rwxrwxrw- 1 ike ike 250 2009-07-25 12:54 show.html.erb
i...@shirma:~/Z/shakodat$

And got

ActionView::MissingTemplate (Missing template authors/index.erb in
view path app/views):
  app/controllers/authors_controller.rb:12:in `index'

Rendering rescues/layout (internal_server_error)
-- 
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.




Re: [haml] Re: Rails not rendering Haml templates

2010-01-08 Thread Nathan Weizenbaum
Have you installed Haml to your project? You should have something in
vendor/plugins/haml. Are you sure you restarted the server?

On Fri, Jan 8, 2010 at 6:09 AM, Iļja Ketris i...@vo.id.lv wrote:


 I am having the same issue.

 Installed HAML:

 haml (2.2.16, 2.2.15, 2.2.9, 2.2.3)
 haml-edge (2.3.100, 2.3.99, 2.3.60, 2.3.27)

 Renamed a template:

 i...@shirma:~/Z/shakodat$ ls -l app/views/authors/
 total 16
 -rwxrwxrw- 1 ike ike 517 2009-07-25 15:00 edit.html.erb
 -rwxr-xr-- 1 ike ike 870 2010-01-08 15:51 index.html.haml
 -rwxrwxrw- 1 ike ike 411 2009-07-25 12:51 new.html.erb
 -rwxrwxrw- 1 ike ike 250 2009-07-25 12:54 show.html.erb
 i...@shirma:~/Z/shakodat$

 And got

 ActionView::MissingTemplate (Missing template authors/index.erb in
 view path app/views):
  app/controllers/authors_controller.rb:12:in `index'

 Rendering rescues/layout (internal_server_error)

 --
 You received this message because you are subscribed to the Google Groups
 Haml group.
 To post to this group, send email to h...@googlegroups.com.
 To unsubscribe from this group, send email to
 haml+unsubscr...@googlegroups.com haml%2bunsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/haml?hl=en.




-- 

You received this message because you are subscribed to the Google Groups "Haml" group.

To post to this group, send email to h...@googlegroups.com.

To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/haml?hl=en.



[haml] Rails not rendering Haml templates

2010-01-01 Thread Ryan
Hello, just trying to use Haml for the first time. I installed the
plugin and can see it in /vendor/plugins/haml. I removed an
index.html.erb review and created a index.html.haml view, but the
browser is giving me this:

Template is missing
Missing template endorsements/index.erb in view path app/views

Any help? Thanks.

--

You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.




Re: [haml] Rails not rendering Haml templates

2010-01-01 Thread Nathan Weizenbaum
Are you sure you've restarted the server? Do you see any errors when you
start it up?

On Fri, Jan 1, 2010 at 11:20 PM, Ryan ryan.mckil...@gmail.com wrote:

 Hello, just trying to use Haml for the first time. I installed the
 plugin and can see it in /vendor/plugins/haml. I removed an
 index.html.erb review and created a index.html.haml view, but the
 browser is giving me this:

 Template is missing
 Missing template endorsements/index.erb in view path app/views

 Any help? Thanks.

 --

 You received this message because you are subscribed to the Google Groups
 Haml group.
 To post to this group, send email to h...@googlegroups.com.
 To unsubscribe from this group, send email to
 haml+unsubscr...@googlegroups.com haml%2bunsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/haml?hl=en.




--

You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.




[haml] Re: debugger doesn't work while inside haml templates

2009-06-21 Thread Dan Z

Your comment is absolutely useless, and it's obvious you don't
appreciate the nature of the problem.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] debugger doesn't work while inside haml templates

2009-06-08 Thread Dan Z

Here's what happens when the debugger is called (anywhere) while the
Haml template is being processed:

INTERNAL ERROR!!! wrong argument type StringIO (expected File)
/var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:
112:in `readline'
/var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:
112:in `readline'
/var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:
62:in `read_command'
/var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/processor.rb:
246:in `process_commands'
/var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/processor.rb:
171:in `__at_line'
(eval):5:in `at_line'
(eval):3:in `synchronize'
(eval):3:in `at_line'
/var/lib/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby-debug-base.rb:
54:in `at_line'
   [ backtrace continues in my application code ]

This is a very annoying problem because almost all my templates are
Haml, and therefore, I can't debug any code that's run while inside
the template.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] Re: debugger doesn't work while inside haml templates

2009-06-08 Thread Bradley Grzesiak
While I might agree that it would be annoying to have any part of an
application immune to debugger calls, the view is the least important area
for it.

Using the debugger immediately before leaving the controller should suffice,
assuming you adhere to strict no-code-in-the-view standards and have full
test coverage of your helpers.

...just sayin'.

:brad

On Mon, Jun 8, 2009 at 11:14 AM, Dan Z danielza...@gmail.com wrote:


 Here's what happens when the debugger is called (anywhere) while the
 Haml template is being processed:

 INTERNAL ERROR!!! wrong argument type StringIO (expected File)

  /var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:
 112:in `readline'

  /var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:
 112:in `readline'

  /var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:
 62:in `read_command'

  /var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/processor.rb:
 246:in `process_commands'

  /var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/processor.rb:
 171:in `__at_line'
(eval):5:in `at_line'
(eval):3:in `synchronize'
(eval):3:in `at_line'

  /var/lib/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby-debug-base.rb:
 54:in `at_line'
   [ backtrace continues in my application code ]

 This is a very annoying problem because almost all my templates are
 Haml, and therefore, I can't debug any code that's run while inside
 the template.

 



-- 
Bradley Grzesiak
listro...@gmail.com
http://toleoandbeyond.blogspot.com

* You have received an email from my personal account. Please do not divulge
this address to any website (eg: evite, shutterfly, etc). I have another
address for such uses; please ask me for it.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] Re: debugger doesn't work while inside haml templates

2009-06-08 Thread Nathan Weizenbaum
Are you sure this is a Haml issue? The debugger works find with Haml on the
command line. Have you tested this with ERB?

2009/6/8 Bradley Grzesiak listro...@gmail.com

 While I might agree that it would be annoying to have any part of an
 application immune to debugger calls, the view is the least important area
 for it.

 Using the debugger immediately before leaving the controller should
 suffice, assuming you adhere to strict no-code-in-the-view standards and
 have full test coverage of your helpers.

 ...just sayin'.

 :brad

 On Mon, Jun 8, 2009 at 11:14 AM, Dan Z danielza...@gmail.com wrote:


 Here's what happens when the debugger is called (anywhere) while the
 Haml template is being processed:

 INTERNAL ERROR!!! wrong argument type StringIO (expected File)

  /var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:
 112:in `readline'

  /var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:
 112:in `readline'

  /var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:
 62:in `read_command'

  /var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/processor.rb:
 246:in `process_commands'

  /var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/processor.rb:
 171:in `__at_line'
(eval):5:in `at_line'
(eval):3:in `synchronize'
(eval):3:in `at_line'

  /var/lib/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby-debug-base.rb:
 54:in `at_line'
   [ backtrace continues in my application code ]

 This is a very annoying problem because almost all my templates are
 Haml, and therefore, I can't debug any code that's run while inside
 the template.





 --
 Bradley Grzesiak
 listro...@gmail.com
 http://toleoandbeyond.blogspot.com

 * You have received an email from my personal account. Please do not
 divulge this address to any website (eg: evite, shutterfly, etc). I have
 another address for such uses; please ask me for it.


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] HAML templates and Rspec / Textmate alternate view jump?

2008-04-19 Thread Mikel Lindsaar

Textmate bundles are something I just have never looked into.

But I have an itch I want to scratch, and before I do, I thought I
would ask the list if someone else has fixed it.

When you do Ctrl-Shift-Down Arrow you are meant to go to the alternate file.

But on my file 'new.html.haml_spec.rb' it wants to find 'new.html.haml.rb'

Also, when you are in new.html.haml and do the alternate file trick,
the bundle does nothing.

Any ideas about how to fix this?  The path is correct, just the files
are not being found.


Mikel

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] Re: HAML templates and Rspec / Textmate alternate view jump?

2008-04-19 Thread s.ross

Hi--

I looked over this code and it's based on file extensions. Works kind  
of like a state machine (if you are looking at a file of type X, you  
can transition to [a, b, c], and so on). You can clone the plugin at:

git://github.com/drnic/ruby-on-rails-tmbundle.git

and have at it.

You'll want to look in Support/lib/rails, and specifically at  
rails_path.rb and command_go_to_file.rb.

Enjoy!


On Apr 19, 2008, at 5:54 PM, Mikel Lindsaar wrote:


 Textmate bundles are something I just have never looked into.

 But I have an itch I want to scratch, and before I do, I thought I
 would ask the list if someone else has fixed it.

 When you do Ctrl-Shift-Down Arrow you are meant to go to the  
 alternate file.

 But on my file 'new.html.haml_spec.rb' it wants to find  
 'new.html.haml.rb'

 Also, when you are in new.html.haml and do the alternate file trick,
 the bundle does nothing.

 Any ideas about how to fix this?  The path is correct, just the files
 are not being found.


 Mikel

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] Haml not being parsed (seems like Rails is ignoring haml templates)

2008-04-11 Thread Olek

Hi,

I have a strange problem, I've been working on my app on Ubuntu and
Haml was working with no problem. Right now I'm trying to get
everything working on Windows Vista, and it seems that Haml is my last
problem.

The thing is that the HAML templates do not get parsed at all. When I
visit my app, all I get as a response is a raw haml template - the
exact content of my .html.haml file. I have the latest gems, and I
have the init.rb file in vendor/plugins.

What could I be doing wrong?

--
Bye,
Olek
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] Re: Haml not being parsed (seems like Rails is ignoring haml templates)

2008-04-11 Thread Nathan Weizenbaum
Are you using the globalize plugin? It has an unresolved bug that causes
this sort of thing.

On Fri, Apr 11, 2008 at 12:05 PM, Olek [EMAIL PROTECTED] wrote:


 Hi,

 I have a strange problem, I've been working on my app on Ubuntu and
 Haml was working with no problem. Right now I'm trying to get
 everything working on Windows Vista, and it seems that Haml is my last
 problem.

 The thing is that the HAML templates do not get parsed at all. When I
 visit my app, all I get as a response is a raw haml template - the
 exact content of my .html.haml file. I have the latest gems, and I
 have the init.rb file in vendor/plugins.

 What could I be doing wrong?

 --
 Bye,
 Olek
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] Re: Haml not being parsed (seems like Rails is ignoring haml templates)

2008-04-11 Thread Olek

 Are you using the globalize plugin? It has an unresolved bug that causes
 this sort of thing.

Wow, that was a quick response! :)

In fact I am using globalize, and
http://groups.google.com/group/haml/browse_thread/thread/b1f73ee2d5b4932c/afebcbea0dcb0dc3
really solves it.

Thanks!
Olek
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] referencing constants from haml templates

2007-11-21 Thread Aman Gupta

require 'rubygems'
require 'haml'

class Test
  A = 'a'
  def initialize
@a = 'b'
  end
end

p Haml::Engine.new(%[
= self.class::A
= @a
]).to_html(Test.new)

# A produces the error: (haml):1: uninitialized constant
Haml::Engine::CompiledTemplates::A (NameError)
# self.class::A works


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] haml templates content.

2007-10-12 Thread John Aughey
Ok, so the subject doesn't make total sense, but I have an idea of how to
use haml to defer some of the layout decisions to an external template.
Maybe this doesn't make sense either.  Here's an example.

I have a site that puts content inside pretty boxes styled with CSS.
In the haml code, it looks something like...

.box
  .title Title of the box
  .content
Here's where all the content goes

Which generates html

div class='box'
  div class='title'This is a test/div
  div class='content'
All my content goes here
  /div
/div

This is all fine, but the haml code has too much layout logic for my taste.
If I changed how a box were to be structured (maybe I want to use a *gasp*
table), everywhere I put something inside this logical box would need to
be modified.

I'm proposing a new special character such as ! or whatever that passes the
evaluated haml block to another template.  The new haml code for the above
example would look like...

!box Title of the box
  Here's where all the content goes

This really says what I mean.  I want a titled box with the following
content.  The previous example put too much of the required layout of having
several nested div sections in the code.

The layout logic would go into another file or block that would be rendered
inline with the same engine.  In this example, there would be a file
_box.haml that looks like:

.box
  .title @args[0]
  .content
@content

So with this template defined of how a box is to be structured, I can then
use this !box tag throughout my thousands of .haml files without worry.  If
I need to modified how the box is structured to use some new CSS style or
presentation, I only need to modify the above template.

Rather than using an external file to render the template, it might be
defined inline with the main haml code, so a single file haml source for
this might look like:

^define_template :box
  .box
.title @args[0]
.content
  @content

!box Title for the box
  Content for the box


I started to look at the haml source to make this modification, but the
learning code was a little steep.  The advantage this has over Rails
partials is the inclusion of the content block that can be inserted wherever
the template feels it should be put and wrapped with whatever layout is
necessary.

John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] Re: haml templates content.

2007-10-12 Thread John Aughey
So I played around with this to see what could be done within the existing
framework.  Here's what I've come up with...

The haml code looks like:

- define_template :titlebar do |content|
  %h1= content

- define_template :box do |title,content|
  .box
.title= title
.content= content

%html
  %body
= eval_template :titlebar,My title

= eval_template :box,My Eval Template Title do
  My internal special content
  = Time.now

- sleep 2

= eval_template :box,Another box do
  This is another box
  = Time.now

The supporting code is surprisingly simple

module Haml
  module Helpers
class TemplateStore
  def self.save(name,block)
@blocks ||= {}
@blocks[name] = *block
  end

  def self.get(name)
@blocks[name]
  end
end

def define_template(name,block)
  TemplateStore.save(name,block)
end

def eval_template(name,*args,block)
  if block_given?
content = capture_haml(block)
args  content
  end

  capture_haml(*args,(TemplateStore.get(name)))
end
  end
end

It has room for improvement, but it's a start.

John

On 10/12/07, John Aughey [EMAIL PROTECTED] wrote:

 Ok, so the subject doesn't make total sense, but I have an idea of how to
 use haml to defer some of the layout decisions to an external template.
 Maybe this doesn't make sense either.  Here's an example.


 I have a site that puts content inside pretty boxes styled with CSS.
 In the haml code, it looks something like...

 .box
   .title Title of the box
   .content
 Here's where all the content goes


 Which generates html

 div class='box'
   div class='title'This is a test/div
   div class='content'
 All my content goes here

   /div
 /div

 This is all fine, but the haml code has too much layout logic for my taste.
 If I changed how a box were to be structured (maybe I want to use a *gasp*
 table), everywhere I put something inside this logical box would need to

 be modified.

 I'm proposing a new special character such as ! or whatever that passes the
 evaluated haml block to another template.  The new haml code for the above
 example would look like...

 !box Title of the box

   Here's where all the content goes

 This really says what I mean.  I want a titled box with the following
 content.  The previous example put too much of the required layout of having
 several nested div sections in the code.


 The layout logic would go into another file or block that would be rendered
 inline with the same engine.  In this example, there would be a file
 _box.haml that looks like:

 .box
   .title @args[0]

   .content
 @content

 So with this template defined of how a box is to be structured, I can then
 use this !box tag throughout my thousands of .haml files without worry.  If
 I need to modified how the box is structured to use some new CSS style or

 presentation, I only need to modify the above template.

 Rather than using an external file to render the template, it might be
 defined inline with the main haml code, so a single file haml source for
 this might look like:


 ^define_template :box
   .box
 .title @args[0]
 .content
   @content

 !box Title for the box
   Content for the box


 I started to look at the haml source to make this modification, but the

 learning code was a little steep.  The advantage this has over Rails
 partials is the inclusion of the content block that can be inserted wherever
 the template feels it should be put and wrapped with whatever layout is

 necessary.

 John



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---



[haml] Re: haml templates not recognized in recent Edge Rails? (REVISION_7468)

2007-09-19 Thread schmeic


  I figured this out - I just needed to stop/start Mongrel after
installing the haml plugin.

-Kevin


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Haml group.
To post to this group, send email to haml@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~--~~~~--~~--~--~---