rss

Jun
16

Renaming your .rhtml to .erb on EdgeRails

Posted (Amit) in Ruby on Rails on 16-06-2008

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
## just slap this in your rake file or in lib/tasks
 
namespace 'views' do
  desc 'Renames all your rhtml views to erb'
  task 'rename' do
    Dir.glob('app/views/**/*.rhtml').each do |file|
      puts `svn mv #{file} #{file.gsub(/\.rhtml$/, '.erb')}`
    end
  end
 end
 
 ## or if you have rhtml and rxml you could probably use the following (untested)
 
 namespace 'views' do
   desc 'Renames all your rhtml views to erb'
   task 'rename' do
     Dir.glob('app/views/**/*.rhtml').each do |file|
       puts `svn mv #{file} #{file.gsub(/\.(rhtml|rxml)$/, '.erb')}`
     end
   end
 end
Share

Post a comment



Amit Yadav is Stephen Fry proof thanks to caching by WP Super Cache