Link tag in Sinatra - ruby

Ok, I am brand new to ruby and Sinatra and I am embarrassed to say I cannot for the life of me find out how to use a link tag in Sinatra. I just need to link, from my index.erb, to a static page, about.html. About is not working. How can I do this? Thanks a lot!

I think you're looking for something like:
About
You're going to want to locate this about.html file in the /public folder of your application.
If you want to overwrite using that location for another one, you can do so with :public_folder and is fairly well described at: http://www.sinatrarb.com/configuration.html
I hope that helps.

Related

Erica CouchDB rewrites

When I upload documents using Erica into CouchDB it removes my rewrites. Is there a way to configure my rewrites in Erica? If so I've been unable to figure it out, any help would be great!
Aha! Got it! So simple... Just add a rewrites.json file to your app directory and it will push it up along with everything else.

how to call a joomla! module in a php page OUTSIDE joomla! directory?

i searched on the net for my answer,but the more i search,the less i find.here is the problem:
i have a joomla! website,located in localhost/joomla.
i have a php page, located in localhost/sample.php
now, how can i include some of joomla's modules,in this single "sample.php" page??
for example, how can i use "latest news" or "latest users" in my "sample.php" page?
one of mye friend did this, but i no longer can contact him. any help would be appreciated. if the question is not clear enough,plz let me know.
tnx
load the Joomla framework inside the external php file
like it says here http://www.irfanview.0fees.net/how-to-load-the-parameters-of-a-joomla-module-inside-an-external-php-file/
I've never had to do this, but first I think you would have to load the Joomla framework (see the installations root index.php) then you would have create a session using Jsession. This is just a guess so take it for what its worth.

How do I create alias for Jekyll static site on Heroku?

I have a Jekyll site running on Heroku.
After site generation, I have a file created public/photos.html. How do I set up Jekyll/Heroku to allow me to access the page as domain.com/photos instead of domain.com/photos.html?
And I'd prefer NOT to have to use rack-rewrite which stands up rack middleware. Seems a bit much for this.
Thanks!
Simplest way is to just name the file photos/index.html instead of photos.html. If that doesn't work for you, you can use the variable permalink in the Front Matter.
You can do route matching in Sinatra and serve whatever pages you like, see: http://www.sinatrarb.com/intro.html

Magento - $this->getSkinUrl() returns Wrong theme in homepage

I use a template with 3 columns in homepage, in my file right_col.phtml I use "$this->getSkinUrl()" and that returns me the wrong theme: /default/default/ instead of /default/my_second_theme, but it works good in all other pages.
How can I fix this problem to get the good theme??
Thanks a lot.
Also make sure that the asset actually exists (or that you specify an existing path). If an asset is not found in any theme, Magento will always use default/default as the resulting skin path.
Check the CMS page for the home page, go to the Design tab, and make sure that you didn't set the "Custom Theme" to something that is overriding the theme that you want to use.
Check the $argument you are passing and verify that the target file actually exists. getSkinUrl() does more than just generate the proper URL, it also verifies that the file exists. If it doesn’t find the file within the store’s /default/my_second_theme folder, it will revert to /default.
Refer to: http://www.nvncbl.com/2009/10/magento-this-getskinurl-wrong-template/
I have used this to solve it :
if (Mage::app()->getStore()->getCode()=='deutsch') {
Mage::getDesign()->setTheme('deutsch');
}
It works good now ;)

Problem when removing index.php from url

dont worry it is not an another how to remove index.php from url question!! :D
i researched and made according to tutorials; here is my source
http://codeigniter.com/wiki/mod_rewrite/
im sure about all steps, but when run it, i dont see any error message… url changes like
www.blablabla.com/contact
www.blablabla.com/about
but it always display homepage :/ thats weird!!
what can be problem? any idea?
thanks a lot! appreciate helps!!
if it always displays the home page it could be that your application isn't configured properly.
Check the system/application/config/config.php file and find the $config['uri_protocol'] option.
If you notice, in the comments there are a number of options you can try. I've found that sometimes on different servers I need to try different options before it will work (I think it's something to do with the PHP configuration, the AUTO option doesn't always get it right).

Resources