Hello,
I’m new to web development and Ruby. In an erb file, I need to provide
a link that will load up another erb file.
I know that if I want to go to an html file I could do this.
Branding
how to I do something like this:
>Branding
So that we go to branding.erb. Does that make sense? thanks
You’re thinking too hard.
Branding
Steve K. 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
Marvin Gülker wrote in post #977698:
Am 26.01.2011 20:13, schrieb Dan T.:
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
Ahh, I was starting to head in that direction but not quite getting it.
Your post helped a ton. Thank you, Marvin!!
Am 26.01.2011 20:13, schrieb Dan T.:
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