Can I redirect output from TPAGE - template-toolkit

I want tpage to redirect the output to a different file.
The redirect filter seems almost to do what I want but when I use it I get :
redirect error - OUTPUT_PATH is not
set
Can I set OUTPUT_PATH using tpage?

this doesn't seem to be possible at the moment. what you could do is apply this patch to tpage / tpage.bat, and specifiy the output_path on the command line then, like
tpage --output_path=DIR [files]

Related

Kibana 4 : Url not formatted properly

I have a field in my index like
path: /abc/nvb/jklk.txt
I autoindex it as string and it is displayed as above. Now, i want to convert it to a url. So in the index settings in Kibana, i apply set this field as a Url and apply
Url Template
hostname:portNumber#{{value}}
Label template
{{value}}
now this field appears as a link in my discover view. But when i click on it, it navigates to
hostName:portNumber#%2Fabc%2Fnvb%2Fjklk.txt
why did all of my /s get replaced by %2F ? Note that, i was expecting the link to navigate to
hostName:portNumber#/abc/nvb/jklk.txt
which is indeed a valid url
I have tried putting the value as
path: //abc//nvb//jklk.txt
and even
path: \/abc\/nvb\/jklk.txt
but the result is the same. The slashes always get encoded. Is there a way to solve this? Will I have to modify my mapping?
it should be
Url Template
hostname:portNumber#{{rawValue}}

Alter the browser URL in Rails

Is there any way to change the browser URL of the request?
Lets say I've a '/articles/foo-bar' and I need to change this to '/articles/foo_bar'.
I've tried Routing Constraints and changed the request.path_info with no luck. I successfully changed the parameters but is not reflected in Browser URL.
PS: I want to replace '-' to '_' in browser URL in overall App.
EDITED:
Routes: get 'brands/:name-:id/articles', to: 'brands#articles'
Here name can be changed dynamically. And if a dash in name should be replaced by underscore.
You can use to_params method on your model
Please check this
http://blog.teamtreehouse.com/creating-vanity-urls-in-rails

nginx - file not found if index.php/filename

Nginx is giving a 'file not found' error if i put another URL param after the index.php:
http://localhost/index.php/testfile.html
How can I make nginx not give this error and treat the '/testfile.html' as a parameter?
Thanks.
In the url you've given, it expects there to be a folder called index.php, but it seems that you want to, in a way, pass the testfile.html to the index.php file, which you can do via GET or POST.
PHP Get
PHP Post
Essentially, if you do something like http://localhost/index.php?file=testfile.html, you can access that variable thorugh $_GET and include it (using PHP).
This is assuming you need to do this dynamically, if you just want to include that file all the time, then you can just use PHP's include capabilities.

Symfony use_javascript() routing issue

i am using symfony 1.4.11; use_helper('Url').
On using link_to('new',course/course/type/new),
the url it show is ../backend_dev/backend_dev/Course/course/type/new
instead of
../backend_dev/Course/course/type/new.
Same issue exist for form_tag also.
Edit
Above issue was solved.By setting no_script_name: true at config and clearing cache.
But image_tag(),use_stylesheet() and use_javascript() gives path as for example
use_javascript('jquery-1.6.1.min.js')
==>../web/backend_dev/js/jquery-1.6.1.min.js
instead of
use_javascript('jquery-1.6.1.min.js') ==>../web/js/jquery-1.6.1.min.js
Any help appreciated.
Hard to say without your full routing.yml but the one thing i see is that your internal_uri should be expressed as an abs url with a query string like:
link_to('new','/Course/course?type=new');
Note the forward slash at the beginning. Also the module name should be the real module name, not the routed one so if the maodule is /apps/backend/modules/Course then the module in the internal URI should be Course not course same with the action name.
If the route is named then you should use one of the following:
link_to('new','#routename?type=new');
OR
link_to('new','routename', array('type'=>'new'));

How do I get output parameters using asp from a exec sproc_name

In asp I'm trying to open a query that contains the exec to a sproc. It works fine with some input params and no output params. But I was trying to create some output params. How do I get the output params from my result set or should I try it a different way?
Check out this article on doing exactly what you want. The first example is reading from a record set and the second example is using output parameters. It shows how to create them and how to set and read their values with ADO:
http://msdn.microsoft.com/en-us/library/aa224819(v=sql.80).aspx

Resources