From: Quintus Date: 2011-01-27T04:39:52+09:00 Subject: Re: link to .erb file, from .erb file Am 26.01.2011 20:13, schrieb Dan Thomas: > Steve Klabnik wrote in post #977681: >> You're thinking too hard. >> >>
  • Branding
  • > > > Thank you. > That takes me to a page that says Sinatra doesn't know this little > ditty. Let me give some background. I have a config.ru file that has > this: > > class App < Sinatra::Base > set :static, true > set :public, File.dirname(__FILE__) + '/static' > > get "/" do > f1 = File.read($XML_PATH) > @xml = Nokogiri::XML(f1) > > erb :index > end > > sinatra/base is required in that file. index.erb is located in my views > folder. Then, as stated above, from that index.erb, I need to load > something like a "branding.erb" page if the user clicks a link. Thanks > This has nothing to do with the view, but how your Sinatra app processes the requests it receives. Add this to your App class: ----------------------------------------------- get "/branding" do erb :branding end ----------------------------------------------- Assuming you want to link to /branding. In your view, you can then just link to it via ----------------------------------------------- Branding ----------------------------------------------- Vale, Marvin