node.js


Sails.js get href for route with params


I'm makeing small Sails.js application. I have a very simple route like:
'/foo': 'FooController.index',
'/foo/:category': 'FooController.category',
My question is: how to make an url in server side rendered view to a category as a param.
I have something like:
<%= sails.getUrlFor('FooController.index') %>
for index, but I'd like to have something like
<%= sails.getUrlFor('FooController.index', {'category':'bar') %>
for a category.
Is there any function to do this like above? I don't want to hardcode the urls.
Thanks in advance and let the power be with you.

Related Links

How to debug request-promise which fail with ETIMEDOUT
How to use Node http-proxy to serve external site in subfolder behind AWS load balancer with SSL
why mongoose queries dos not work when put inside promise function
How do I export a node.js module which is inside the Promise.all (somefunction) . then (function (){})
How to fix error when installing node.js on windows 7 32bit
PdfKit doc.pipe() error
Add custom login form to hapi-auth-basic
start command not working with node js firereader
node js scheduler iterates 3 times while it supposed to Fire only one Time
Rename uploaded images using MULTER
jsDoc: how to get object of required module
How do I send a buffer in an HTTP request?
MongoDB connection with Robomong
Use Axios or fetch to make self REST Api call inside Node?
How to run Ramme with sourcecode
How to get multiple content areas in hapi.js ejs layouts?

Categories

HOME
.htaccess
arduino
raster
reporting-services
hardware
asp-classic
cakephp-3.0
metal
bootstrap-datepicker
pymc
geoserver
pygtk
rhel
relation
httpresponse
angularjs-ng-route
watchkit
postgresql-9.0
biopython
serenity-bdd
couchbase-view
jquery-animate
mdm
tv
pfsense
coap
jsdata
formsets
edi
u2
biblatex
omnipay
python-tesseract
required
artoolkit
psftp
basic4android
apache-hive
sqlcmd
oracle-data-modeler
interactive
sphero-api
enzyme
xilinx-edk
spring-cloud-sleuth
nsset
background-position
audiounit
object-oriented-analysis
miva
rtai
smart-pointers
ch
deferred-loading
giflib
powergrep
android-selector
lunrjs
oslo
data-connections
struts2-jquery-grid
shapely
idiorm
sparklines
meter
django-pipeline
unexpectendoffile
gamma-function
ontouchevent
slab
virtual-address-space
chap-links-library
pegjs
nxt-python
deface
n-tier
sine-wave
android-x86
usermode
stubs
sencha-touch-2.2
nodejitsu
meteor-slides
icommand
panning
dynamic-language-runtime
server-side-scripting
wexitstatus
hyperterminal
appmobi
utl-file
viewstack
glossary
spaces
cloning
log5j
juggernaut
smalldatetime
validationsummary

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile