This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mime::Type.register_alias "text/html", :mobile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_filter :prepare_for_mobile | |
private | |
def mobile_device? | |
if session[:mobile_param] | |
session[:mobile_param] == "1" | |
else | |
request.user_agent =~ /Mobile|webOS/ | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mime::Type.register_alias "text/html", :mobile | |
Mime::Type.register_alias "text/html", :iPad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Mobile</title> | |
<%= stylesheet_link_tag "/jqtouch/jqtouch.css", "/jqtouch/themes/jqt/theme.css" %> | |
<%= javascript_include_tag "/jqtouch/jquery-1.4.2.min.js", "/jqtouch/jqtouch.js", "mobile" %> | |
<%= csrf_meta_tag %> | |
</head> | |
<body> | |
<div class="home"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.jQTouch({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pax@ubuntu:~/projects/missionhub$ ruby -v | |
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux] | |
pax@ubuntu:~/projects/missionhub$ rails -v | |
Rails 3.1.3 | |
pax@ubuntu:~/projects/missionhub$ rake -V | |
rake, version 0.9.2.2 | |
pax@ubuntu:~/projects/missionhub$ bundle exec rake db:migrate --trace | |
DEPRECATION WARNING: Yajl's JSON gem compatibility API is going to be removed in 2.0 | |
** Invoke db:migrate (first_time) | |
** Invoke environment (first_time) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
bitly_username: yourusername | |
bitly_key: yourkey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require Rails.root.join('config','initializers','load_config') | |
Bitly.use_api_version_3 | |
BITLY_CLIENT = Bitly.new(APP_CONFIG['bitly_username'], APP_CONFIG['bitly_key']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3p0 :002 > BITLY_CLIENT | |
=> #<Bitly::V3::Client:0xb653398 @default_query_opts={:login=>"yourusername", :apiKey=>"yourkey"}> | |
1.9.3p0 :001 > BITLY_CLIENT.shorten("http://google.com") | |
=> #<Bitly::V3::Url:0xb5658c8 @client=#<Bitly::V3::Client:0xb653398 @default_query_opts={:login=>"yourusername", :apiKey=>"yourkey"}>, @short_url="http://bit.ly/xFMlrA", @long_url="http://google.com/", @user_hash="xFMlrA", @global_hash="LmvF", @new_hash=false, @user_clicks=nil, @global_clicks=nil, @title=nil, @created_by=nil, @aggregate_link=nil, @clicks_by_minute=nil> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository ppa:ubuntu-on-rails/ppa | |
sudo apt-get update | |
sudo apt-get install gedit-gmate | |
sudo apt-get install gedit-plugins |
OlderNewer