Les, thank you for your response.

The bit of code you mention is indeed in rails_path.rb

Since I am on Rails 3, I modified it as follows:

  def wants_haml
    @wants_html ||= File.file?(File.join(rails_root, "vendor/plugins/
haml/", "init.rb")) ||
      File.read(File.join(rails_root, 'config', 'environment.rb')) =~ /
haml/ ||
      File.read(File.join(rails_root, 'Gemfile')) =~ /haml/
  end

and it seems to work. I wonder, however, if I am missing something,
like I should be using different bundles for Rails 3 altogether.

Sorry if this is now off-topic.

Giuseppe

On Sep 28, 7:07 pm, Les <[email protected]> wrote:
> As far as I can tell, the decision whether to go to a .haml file or
> a .erb file is triggered by the presence of config.gem 'haml' in your
> environment.rb file (pre Rails3 of course)
>
> I say this because in the rails bundle, there is a switch that detects
> whether your app is working on haml. If you look in:
> /Library/Application Support/TextMate/Pristine Copy/Bundles/Ruby on
> Rails.tmbundle/Support/lib/rails/rails_path.rb
>
> (maybe the path on your system is not the same as mine, so look for
> that file, rails_path.rb)
>
> you'll see the switch
>
> If you're not seeing it, then maybe you need to update your rails
> bundle?
>
> On Sep 28, 3:12 am, giuseb <[email protected]> wrote:
>
> > Yes, I have the "handcrafted" bundle:
>
> >http://github.com/handcrafted/handcrafted-haml-textmate-bundle.git
>
> > However, is that relevant?
>
> > If I am in a RoR controller, with the cursor inside, say, the index
> > action, and I press alt-cmd-arrow down, the *rails* bundle searches
> > for the corresponding view file and, not finding an index.html.erb in
> > the expected directory, it prompts me to create one. What I want,
> > however, is for that command to look for index.html.haml instead. This
> > should be possible by tweaking the rails bundle, independent of
> > whether you also have a haml bundle installed, right?
>
> > I hope my question is clear.
> > Thanks!
>
> > Giuseppe
>
> > On Sep 6, 6:46 am, Les <[email protected]> wrote:
>
> > > Do you have the haml bundle installed?
>
> > > On Sep 4, 12:36 pm, giuseb <[email protected]> wrote:
>
> > > > Hello,
>
> > > > does anyone know how to make the Ruby on Rails TextMatebundle
> > > > "understand" that HAML is the preferred templating language?
>
> > > > Commands such as "go to alternate file" in thebundleare extremely
> > > > useful (e.g., press alt-cmd-arrow down while the cursor is within a
> > > > controller's index function to jump to the corresponding view file)
> > > > but they look for .erb files and ask me to create one.
>
> > > > I wonder if there is a global setting within the railsbundleto
> > > > replace .erb with .haml.
>
> > > > Thanks!
> > > > Giuseppe
>
> > > > p.s. incidentally, the rails tmbundle I am currently using is
> > > > carlosbrando's fork
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" 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/haml?hl=en.

Reply via email to