This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
urls = "" | |
DATA.each do |l| | |
img = l[/url\([^)]*\)/] | |
urls << "<img src=#{img.gsub(/url\(([^)]*)\)/, '\1')} /><hr />\n" if img | |
end | |
f = File.open("urltest.html", "w") {|file| file.truncate(0) } # Clear file contents | |
f = File.open("urltest.html", "w") | |
f.write urls | |
f.close |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
# | |
# I originally needed to create a sidebar partial that had a div area where I could place custom links into. Finally found it. | |
# When I was trying to figure this out before and realized I needed to pass the view into :layout, rather than just using render 'layout'. Not sure why the block can't be passed otherwise but nonetheless... | |
# | |
# For explanation of options see | |
# http://guides.rubyonrails.org/layouts_and_rendering.html#options-for-render | |
# | |
%> |
NewerOlder