I'm trying to use CloudMade's route service.
I want to display a Route between two locations in my standalone application, but there isn't any tutorial in CloudMade's website that handle this.
How can I display the Route?
Appreciate any help.
for Blackberry/J2ME CloudMade only gives own tiles, libraries are from nutiteq.
Here are their examples including routing: http://www.nutiteq.com/lib-application-samples.
Related
I'm developing my first useful rails app at the moment and have a general question.
How are bigger applications like digitalocean.com or invisionapp.com set up:
Are the website and control panel always two different applications?
If not, what is the setup to seperate these two in one app on different subdomains, for example with rails?
I hope the question is clear, I wasn't able two find an answer.
Thanks in advance!
Check you this question Rails routing to handle multiple domains on single application
I'm not sure about digital ocean architecture, but I think that they have multiple apps.
At the beginning of learning rails it is not necessary to build website and control panel as different apps.
Let them be a single app, just locate them on different subdomains.
And with help of constrains in routes.rb you can route requests to different controllers, depending on required domain.
I'm trying to learn a bit more about creating friendly URLs, particularly in relation to something like an e-commerce site. If you take a look at this site as an example: http://www.wiggle.co.uk/
It basically lets you refine your search based on the categories. So if I go to http://www.wiggle.co.uk/mens/road-time-trial-bikes/ it will list all men's road bikes, if I then go to http://www.wiggle.co.uk/road-time-trial-bikes/ it will list men's and women's bikes, and if I go to http://www.wiggle.co.uk/bianchi-sempre-105/ it will display a particular bike.
I'm not really sure what the routing would look like for something like this, as you could have many filters in the URL. I'm also not sure how how it's able to distinguish between what's a filter and what's a product.
I'd say you are fairly close but would break out the second and third as it would be a little ambiguous for the one Action to interpret the two parameters. I'd suggest the following:
http://www.wiggle.co.uk/road-time-trial-bikes/
http://www.wiggle.co.uk/bikes/bianchi-sempre-105/
Thus /bikes/ could be routed clearly to a different controller and action. You would need to create a specific rule for the root or you could add a specific controller, say bike-types, to the first url
http://www.wiggle.co.uk/bike-types/road-time-trial-bikes/
The specifics on routing are well documented but a good place to start might be with writing some tests to help you understand what works and give you more confidence with making changes to your routes. It is very easy to create clashing routes and tests help prevent this.
http://mvccontrib.codeplex.com/wikipage?title=TestHelper#Routes
I'm trying to build a simple web app using the Google Map API. I haven't decided if I want to use Rails or Django yet. I've been looking for some tutorials, but none have given me really what I'm looking for. Understand, I'm a newbie when it comes to both Rails and Django.
What I want to do is like this:
http://durasupreme.com/dealer-locator
Where you type in a zip code and it returns a map with pins for the locations on a map. I already have the database information, I'm just wondering what the best way to do this. I feel like I have the idea, I know the tools I need to use, but I don't know how to put it all together.
Any help or links to resources would be greatly appreciated.
D
Here are a few useful links if you decide to go for Rails:
Geocoder
Railscast about Geocoder
Google Maps for Rails
What you are trying to do doesn't have much to do with Django or Rails. It will be mostly javascript. Here's a simple implementation outline:
Follow the tutorials to get started on google maps api on a static local html file.
In javascript write a map_init and add_marker helper functions.
When confident, add the link, div, and script tags you wrote to your template.
Have your view/controller method get a list of objects from the db.
Pass them to the template
In the template do a for loop over the object list.
inside the loop use the appropriate obj attributes to feed the add_marker helper function.
This is not a question of how to implement multi-tenancy. What I am looking for is the ability to optionally override the default application routes when required.
A simple case is that I have a route that generates a blog url like so:
http://[domain]/blog/post-slug
My configuration is blog/{slug}
However, some tenants do wish to call their blog "news". Although I can change all references blog in their views, I can't do it in the URL.
I would like a simple way of overriding these route configurations without changing the "core" codebase.
One thought I had would be to use named routes and then use this to swap out route configurations when the app starts. I should add that multiple tenants will not be using the same application instance, just the same codebase.
Thanks,
Ben
You can always add a route using a regular expression. There is also a great tool on figuring out what routes to add to get what you want.
http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx
What about if you have a filter that detects which type of user is accessing the action. If it is one who wants the word news, you can redirect them to a controller called news - which inherits all the functionality from blog.
I can't say I'm 100% confident, but I think it might work.
About 10 stackoverflow.com podcasts back Jeff mentioned that instead of wiring up his routes inside of the global.asax file he instead put them inside his controllers near the actions those routes would invoke.
How does one go about doing this?
Doesn't a route have to be registered before the controller it routes to is hit? Does he do it in the constructor? My mind is baffled by a chicken vs. egg issue here.
Check out this question.
I highly recommend you this approach. I'm using it with great success. :)
Basic idea - we are using attribute to setup a route for specific action.
In global.asax at app start we use reflection to initialize routes.
EDIT:
More precise link here.
EDIT2:
Not related to question but might be worth checking out (in case you haven't):
RESTful URLs from MVCContrib.