Skip to content

Commit

Permalink
added download link for mobile routes
Browse files Browse the repository at this point in the history
  • Loading branch information
mokolabs committed Apr 18, 2012
1 parent 7599e02 commit 2df26ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions routy.rb
Expand Up @@ -85,3 +85,11 @@ class Route < ActiveRecord::Base
File.read(File.join('public', 'javascripts', 'logic.js'))
)
end

get '/download/mobile' do
content_type :js
attachment('mobile_routes.js')
response.write(
'var map = {"routes":' + Route.unscoped.order("inbound DESC").to_json + '};'
)
end
6 changes: 5 additions & 1 deletion views/index.erb
Expand Up @@ -82,6 +82,10 @@
<% end %>
</table>

<p id="download"><a href="/download">Download routes&raquo;</a></p>
<p id="download">
<a href="/download">Download routes for desktop&darr;</a>
&nbsp;&nbsp;
<a href="/download/mobile">Download routes for mobile&darr;</a>
</p>

</body>

0 comments on commit 2df26ee

Please sign in to comment.