Mobilize  Your Rails Application <ul><li>Brendan Lim </li></ul><ul><li>e-mail:  [email_address]   </li></ul><ul><li>twitte...
 
Why care about  mobile <ul><li>There’s an estimated 2.9 billion mobile users </li></ul><ul><li>Over 255 million mobile use...
Some  mobile  stats (in billions of course)
So, how do we take advantage of this?
Make your application accessible by the majority of   web enabled   mobile  devices devices devices
Keep your users engaged through  SMS ,  MMS   and  E-Mail E-Mail
Many  Mobile  Devices Can Access the Real Web From Flickr User Carlos Magaña
One Web Making the same information and services available to all users regardless of the device used Making the same info...
<ul><li>Max resolution? </li></ul><ul><li>JavaScript? </li></ul><ul><li>Flash? </li></ul><ul><li>Connection speed? </li></...
Mobile Fu  Plugin <ul><li>Can detect if a user is on a mobile device </li></ul><ul><li>Ability to add custom styling based...
How does one master  mobile  fu?
Not   Like This ...
Maybe   Like This ...
class ApplicationController < ActionController::Base  has_mobile_fu end end
demo. presentlyapp.com iPhone Safari
respond_to  do | format | format.html format.mobile end <ul><li>views/ </li></ul><ul><li>layouts </li></ul><ul><ul><li>app...
<%= mobile_xhtml_doctype %> <html> <head> ... </head> <body> ... </body> </html> </html> ../layouts/ application.mobile.er...
<?xml version=&quot;1.0&quot; charset=&quot;UTF-8&quot; ?> <!DOCTYPE html PUBLIC &quot;-//WAPFORUM//DTD XHTML Mobile 1.0//...
Is the user using a specific device? is_device?( ‘blackberry’ ) Is the user using a mobile device? is_mobile_device? Is th...
iPhone   foo_ mobilewebkit .css  <%= stylesheet_link_tag 'foo' %> Android   foo_ mobilewebkit .css  BlackBerry   foo_ blac...
 
What about leveraging other  mobile   technologies ?
SMS Short Message Service Short Message Service
Keep Users Informed with  SMS <ul><li>Text messages are read by about 94% of their recipients. </li></ul><ul><li>Supported...
What tools can we use to send  SMS  messages from our Rails application?
Clickatell  Gem <ul><li>Paid solution </li></ul><ul><li>Uses Clickatell’s API </li></ul><ul><li>Currently $0.043 per text ...
api  =  Clickatell::API.authenticate(' your_api_id ',  ' your_username ', ' your_password ') api.send_message(' 5558675309...
SMS Fu  Plugin <ul><li>Doesn’t cost the sender anything </li></ul><ul><li>Leverages ActionMailer to send a  text message <...
Wait, it’s free? So how does it work?
Number:  555-867-5309 5558675309 @ vtext.com Carrier:  Verizon
deliver_sms(‘ 5558675309 ’,‘ verizon ’, ‘ hello! ’) class AwesomeController < ApplicationController  has_sms_fu end end
Some  SMS  Fu Carriers Alltell, Ameritech, AT&T, Bell South Mobility, BlueSkyFrog, Boost Mobile, Cellular South, Kajeet, M...
What if I want to add a new carrier called  Ruby Mobile ?
carriers: ... ruby_mobile:  name: Ruby Mobile  value: @txt.rubymobile.com  Add the following to   .../config/sms_fu.yml de...
Remind Your Users That They May Get Charged from flickr user ‘bowbrick’
MMS Multimedia Message Service Multimedia Message Service
MMS <ul><li>Can send photo, video, audio or other attachments </li></ul><ul><li>Most commonly used for photos </li></ul><u...
The Problem with Receiving  MMS Crap Crap Crap Cat
Well, how can I receive  SMS  or  MMS  from my Rails app ?
Short Codes Special numbers that are, you guessed it, short, that can be used to receive SMS or MMS messages from mobile p...
 
Short Codes <ul><li>Also referred to as short numbers </li></ul><ul><li>MMS support added in this year </li></ul><ul><li>C...
Receiving  SMS  or  MMS  as an e-mail is another solution and its free and relatively simple
MMS2R  Gem <ul><li>Removes carrier advertising </li></ul><ul><li>Eliminates carrier default text </li></ul><ul><li>Decodes...
Retrieve only the intended attachment mms.default_media Retrieve all media files from the MMS mms.media Retrieve only the ...
<ul><li>require ‘ mms2r ’ </li></ul><ul><li>class   MailReceiver  <  ActionMailer::Base </li></ul><ul><li>def   receive (e...
<ul><li>require ‘ mms2r ’ </li></ul><ul><li>class   MailReceiver  <  ActionMailer::Base </li></ul><ul><li>def   receive (e...
<ul><li>require ‘ mms2r ’ </li></ul><ul><li>class   MailReceiver  <  ActionMailer::Base </li></ul><ul><li>def   receive (e...
<ul><li>require ‘ mms2r ’ </li></ul><ul><li>class   MailReceiver  <  ActionMailer::Base </li></ul><ul><li>def   receive (e...
<ul><li>require ‘ mms2r ’ </li></ul><ul><li>class   MailReceiver  <  ActionMailer::Base </li></ul><ul><li>def   receive (e...
<ul><li>require ‘ mms2r ’ </li></ul><ul><li>class   MailReceiver  <  ActionMailer::Base </li></ul><ul><li>def   receive (e...
<ul><li>require ‘ mms2r ’ </li></ul><ul><li>class   MailReceiver  <  ActionMailer::Base </li></ul><ul><li>def   receive (e...
Adding new templates for carriers is easy <ul><li>--- </li></ul><ul><li>ignore: </li></ul><ul><li>   image / gif:  </li></...
Mobilizing  your Rails app is simple and easy
Mobile Fu http://github.com/brendanlim/mobile-fu/ Clickatell http://clickatell.rubyforge.org/ SMS Fu http://github.com/bre...
Questions!
Upcoming SlideShare
Loading in …5
×

Mobilizing Your Rails Application - LA Ruby Conference 2009

4,653 views

Published on

Mobilize Your Rails Application - Slides from talk by Brendan G. Lim at LA Ruby Conference 2009 in Tustin, CA.

Published in: Technology, Business
0 Comments
11 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,653
On SlideShare
0
From Embeds
0
Number of Embeds
33
Actions
Shares
0
Downloads
105
Comments
0
Likes
11
Embeds 0
No embeds

No notes for slide
  • Mobilizing Your Rails Application - LA Ruby Conference 2009

    1. 1. Mobilize Your Rails Application <ul><li>Brendan Lim </li></ul><ul><li>e-mail: [email_address] </li></ul><ul><li>twitter: @brendanlim </li></ul>
    2. 3. Why care about mobile <ul><li>There’s an estimated 2.9 billion mobile users </li></ul><ul><li>Over 255 million mobile users in the U.S. </li></ul><ul><li>In developing nations, a mobile phone is sometimes their only way to connect to the Internet </li></ul>
    3. 4. Some mobile stats (in billions of course)
    4. 5. So, how do we take advantage of this?
    5. 6. Make your application accessible by the majority of web enabled mobile devices devices devices
    6. 7. Keep your users engaged through SMS , MMS and E-Mail E-Mail
    7. 8. Many Mobile Devices Can Access the Real Web From Flickr User Carlos Magaña
    8. 9. One Web Making the same information and services available to all users regardless of the device used Making the same information and services available to all users regardless of the device used
    9. 10. <ul><li>Max resolution? </li></ul><ul><li>JavaScript? </li></ul><ul><li>Flash? </li></ul><ul><li>Connection speed? </li></ul><ul><li>Processor speed? </li></ul>Problems with one web
    10. 11. Mobile Fu Plugin <ul><li>Can detect if a user is on a mobile device </li></ul><ul><li>Ability to add custom styling based on the device’s user agent </li></ul><ul><li>Gives you some tools to make the concept of one web easier to achieve </li></ul>
    11. 12. How does one master mobile fu?
    12. 13. Not Like This ...
    13. 14. Maybe Like This ...
    14. 15. class ApplicationController < ActionController::Base has_mobile_fu end end
    15. 16. demo. presentlyapp.com iPhone Safari
    16. 17. respond_to do | format | format.html format.mobile end <ul><li>views/ </li></ul><ul><li>layouts </li></ul><ul><ul><li>application.html.erb </li></ul></ul><ul><ul><li>application.mobile.erb </li></ul></ul><ul><li>sessions </li></ul><ul><ul><li>new.html.erb </li></ul></ul><ul><ul><li>new.mobile.erb </li></ul></ul>
    17. 18. <%= mobile_xhtml_doctype %> <html> <head> ... </head> <body> ... </body> </html> </html> ../layouts/ application.mobile.erb http://mobiforge.com/designing/story/comparison-xhtml-mobile-profile-and-xhtml-basic
    18. 19. <?xml version=&quot;1.0&quot; charset=&quot;UTF-8&quot; ?> <!DOCTYPE html PUBLIC &quot;-//WAPFORUM//DTD XHTML Mobile 1.0//EN&quot; &quot; http://www.wapforum.org/DTD/xhtml-mobile10.dtd &quot;> <html> <head> ... </head> <body> ... </body> </html> </html> ../layouts/ application.mobile.erb http://mobiforge.com/designing/story/comparison-xhtml-mobile-profile-and-xhtml-basic
    19. 20. Is the user using a specific device? is_device?( ‘blackberry’ ) Is the user using a mobile device? is_mobile_device? Is the request format currently :mobile ? in_mobile_view?
    20. 21. iPhone foo_ mobilewebkit .css <%= stylesheet_link_tag 'foo' %> Android foo_ mobilewebkit .css BlackBerry foo_ blackberry .css Win Mobile foo_ mobileexplorer .css etc...
    21. 23. What about leveraging other mobile technologies ?
    22. 24. SMS Short Message Service Short Message Service
    23. 25. Keep Users Informed with SMS <ul><li>Text messages are read by about 94% of their recipients. </li></ul><ul><li>Supported by almost all mobile phones out there </li></ul><ul><li>Good for quick notifications </li></ul><ul><li>Generally limited to 160 characters </li></ul><ul><li>Relatively easy to leverage </li></ul>
    24. 26. What tools can we use to send SMS messages from our Rails application?
    25. 27. Clickatell Gem <ul><li>Paid solution </li></ul><ul><li>Uses Clickatell’s API </li></ul><ul><li>Currently $0.043 per text message sent within the U.S. </li></ul><ul><li>No need to know the recipient’s carrier </li></ul>
    26. 28. api = Clickatell::API.authenticate(' your_api_id ', ' your_username ', ' your_password ') api.send_message(' 5558675309 ', ' Hello from clickatell ') require 'clickatell'
    27. 29. SMS Fu Plugin <ul><li>Doesn’t cost the sender anything </li></ul><ul><li>Leverages ActionMailer to send a text message </li></ul><ul><li>You need to know the recipient’s carrier </li></ul><ul><li>Not as many supported carriers as Clickatell </li></ul>
    28. 30. Wait, it’s free? So how does it work?
    29. 31. Number: 555-867-5309 5558675309 @ vtext.com Carrier: Verizon
    30. 32. deliver_sms(‘ 5558675309 ’,‘ verizon ’, ‘ hello! ’) class AwesomeController < ApplicationController has_sms_fu end end
    31. 33. Some SMS Fu Carriers Alltell, Ameritech, AT&T, Bell South Mobility, BlueSkyFrog, Boost Mobile, Cellular South, Kajeet, Metro PCS, Powertel, PSC Wireless, Qwest, Southern Link, Spring, Rodgers, Suncom, T-Mobile, Virgin Mobile, Verizon Wireless , E-Plus, O2, Orange, Telconica, Vodafone ...
    32. 34. What if I want to add a new carrier called Ruby Mobile ?
    33. 35. carriers: ... ruby_mobile: name: Ruby Mobile value: @txt.rubymobile.com Add the following to .../config/sms_fu.yml deliver_sms(‘ 5558675309 ’,’ ruby_mobile ’, ‘ hello! ’)
    34. 36. Remind Your Users That They May Get Charged from flickr user ‘bowbrick’
    35. 37. MMS Multimedia Message Service Multimedia Message Service
    36. 38. MMS <ul><li>Can send photo, video, audio or other attachments </li></ul><ul><li>Most commonly used for photos </li></ul><ul><li>Attachment size limitation generally dependent on device </li></ul><ul><li>Multipart MIME </li></ul>
    37. 39. The Problem with Receiving MMS Crap Crap Crap Cat
    38. 40. Well, how can I receive SMS or MMS from my Rails app ?
    39. 41. Short Codes Special numbers that are, you guessed it, short, that can be used to receive SMS or MMS messages from mobile phones. Special numbers that are, you guessed it, short, that can be used to receive SMS or MMS messages from mobile phones.
    40. 43. Short Codes <ul><li>Also referred to as short numbers </li></ul><ul><li>MMS support added in this year </li></ul><ul><li>Crazy Expensive </li></ul><ul><ul><li>Monthly fees up to $1000/mo </li></ul></ul><ul><ul><li>Setup fees close to $5000 </li></ul></ul><ul><li>Many companies share short codes </li></ul>
    41. 44. Receiving SMS or MMS as an e-mail is another solution and its free and relatively simple
    42. 45. MMS2R Gem <ul><li>Removes carrier advertising </li></ul><ul><li>Eliminates carrier default text </li></ul><ul><li>Decodes and extracts intended files from the multipart MIME e-mail </li></ul><ul><li>Most major carriers are supported </li></ul>
    43. 46. Retrieve only the intended attachment mms.default_media Retrieve all media files from the MMS mms.media Retrieve only the intended message mms.body Create a new MMS2R object from a TMail object mms = MMS2R::Media.new(email)
    44. 47. <ul><li>require ‘ mms2r ’ </li></ul><ul><li>class MailReceiver < ActionMailer::Base </li></ul><ul><li>def receive (email) </li></ul><ul><li>begin </li></ul><ul><ul><ul><li># load the TMail object into an MMS2R::Media object </li></ul></ul></ul><ul><ul><ul><li>mms = MMS2R::Media .new(email) </li></ul></ul></ul><ul><ul><ul><li># grab a user on record by the e-mail it was sent from </li></ul></ul></ul><ul><ul><ul><li>user = User .find_by_email(mms.from) </li></ul></ul></ul><ul><ul><ul><li># store the body of the mms into a new BlogPost </li></ul></ul></ul><ul><ul><ul><li>blog_post = BlogPost .create(: body => mms.body, : user => user, </li></ul></ul></ul><ul><ul><ul><ul><li>: title => mms.subject) </li></ul></ul></ul></ul><ul><ul><ul><li># grab the attachment from the mms message </li></ul></ul></ul><ul><ul><ul><li>media = mms.default_media </li></ul></ul></ul><ul><ul><ul><li># store the attachment from mms into a BlogPhoto </li></ul></ul></ul><ul><ul><ul><li>BlogPhoto .create(: uploaded_data => media, : blog_post => blog_post) if </li></ul></ul></ul><ul><ul><ul><ul><li>media.content_type.include?(‘ image ’) </li></ul></ul></ul></ul><ul><ul><li>ensure </li></ul></ul><ul><ul><ul><li># cleans up temporary files used for text and attachments </li></ul></ul></ul><ul><ul><ul><li>mms.purge </li></ul></ul></ul><ul><ul><li>end </li></ul></ul><ul><li>end </li></ul><ul><li>end </li></ul>
    45. 48. <ul><li>require ‘ mms2r ’ </li></ul><ul><li>class MailReceiver < ActionMailer::Base </li></ul><ul><li>def receive (email) </li></ul><ul><li>begin </li></ul><ul><ul><ul><li># load the TMail object into an MMS2R::Media object </li></ul></ul></ul><ul><ul><ul><li>mms = MMS2R::Media . new (email) </li></ul></ul></ul><ul><ul><ul><li># grab a user on record by the e-mail it was sent from </li></ul></ul></ul><ul><ul><ul><li>user = User .find_by_email(mms.from) </li></ul></ul></ul><ul><ul><ul><li># store the body of the mms into a new BlogPost </li></ul></ul></ul><ul><ul><ul><li>blog_post = BlogPost .create(: body => mms.body, : user => user, </li></ul></ul></ul><ul><ul><ul><ul><li>: title => mms.subject) </li></ul></ul></ul></ul><ul><ul><ul><li># grab the attachment from the mms message </li></ul></ul></ul><ul><ul><ul><li>media = mms.default_media </li></ul></ul></ul><ul><ul><ul><li># store the attachment from mms into a BlogPhoto </li></ul></ul></ul><ul><ul><ul><li>BlogPhoto .create(: uploaded_data => media, : blog_post => blog_post) if </li></ul></ul></ul><ul><ul><ul><ul><li>media.content_type.include?(‘ image ’) </li></ul></ul></ul></ul><ul><ul><li>ensure </li></ul></ul><ul><ul><ul><li># cleans up temporary files used for text and attachments </li></ul></ul></ul><ul><ul><ul><li>mms.purge </li></ul></ul></ul><ul><ul><li>end </li></ul></ul><ul><li>end </li></ul><ul><li>end </li></ul>
    46. 49. <ul><li>require ‘ mms2r ’ </li></ul><ul><li>class MailReceiver < ActionMailer::Base </li></ul><ul><li>def receive (email) </li></ul><ul><li>begin </li></ul><ul><ul><ul><li># load the TMail object into an MMS2R::Media object </li></ul></ul></ul><ul><ul><ul><li>mms = MMS2R::Media .new(email) </li></ul></ul></ul><ul><ul><ul><li># grab a user on record by the e-mail it was sent from </li></ul></ul></ul><ul><ul><ul><li>user = User .find_by_email( mms.from ) </li></ul></ul></ul><ul><ul><ul><li># store the body of the mms into a new BlogPost </li></ul></ul></ul><ul><ul><ul><li>blog_post = BlogPost .create(: body => mms.body, : user => user, </li></ul></ul></ul><ul><ul><ul><ul><li>: title => mms.subject) </li></ul></ul></ul></ul><ul><ul><ul><li># grab the attachment from the mms message </li></ul></ul></ul><ul><ul><ul><li>media = mms.default_media </li></ul></ul></ul><ul><ul><ul><li># store the attachment from mms into a BlogPhoto </li></ul></ul></ul><ul><ul><ul><li>BlogPhoto .create(: uploaded_data => media, : blog_post => blog_post) if </li></ul></ul></ul><ul><ul><ul><ul><li>media.content_type.include?(‘ image ’) </li></ul></ul></ul></ul><ul><ul><li>ensure </li></ul></ul><ul><ul><ul><li># cleans up temporary files used for text and attachments </li></ul></ul></ul><ul><ul><ul><li>mms.purge </li></ul></ul></ul><ul><ul><li>end </li></ul></ul><ul><li>end </li></ul><ul><li>end </li></ul>
    47. 50. <ul><li>require ‘ mms2r ’ </li></ul><ul><li>class MailReceiver < ActionMailer::Base </li></ul><ul><li>def receive (email) </li></ul><ul><li>begin </li></ul><ul><ul><ul><li># load the TMail object into an MMS2R::Media object </li></ul></ul></ul><ul><ul><ul><li>mms = MMS2R::Media .new(email) </li></ul></ul></ul><ul><ul><ul><li># grab a user on record by the e-mail it was sent from </li></ul></ul></ul><ul><ul><ul><li>user = User .find_by_email(mms.from) </li></ul></ul></ul><ul><ul><ul><li># store the body of the mms into a new BlogPost </li></ul></ul></ul><ul><ul><ul><li>blog_post = BlogPost .create(: body => mms.body , </li></ul></ul></ul><ul><ul><ul><ul><li>: user => user, : title => mms.subject ) </li></ul></ul></ul></ul><ul><ul><ul><li># grab the attachment from the mms message </li></ul></ul></ul><ul><ul><ul><li>media = mms.default_media </li></ul></ul></ul><ul><ul><ul><li># store the attachment from mms into a BlogPhoto </li></ul></ul></ul><ul><ul><ul><li>BlogPhoto .create(: uploaded_data => media, : blog_post => blog_post) if </li></ul></ul></ul><ul><ul><ul><ul><li>media.content_type.include?(‘ image ’) </li></ul></ul></ul></ul><ul><ul><li>ensure </li></ul></ul><ul><ul><ul><li># cleans up temporary files used for text and attachments </li></ul></ul></ul><ul><ul><ul><li>mms.purge </li></ul></ul></ul><ul><ul><li>end </li></ul></ul><ul><li>end </li></ul><ul><li>end </li></ul>
    48. 51. <ul><li>require ‘ mms2r ’ </li></ul><ul><li>class MailReceiver < ActionMailer::Base </li></ul><ul><li>def receive (email) </li></ul><ul><li>begin </li></ul><ul><ul><ul><li># load the TMail object into an MMS2R::Media object </li></ul></ul></ul><ul><ul><ul><li>mms = MMS2R::Media .new(email) </li></ul></ul></ul><ul><ul><ul><li># grab a user on record by the e-mail it was sent from </li></ul></ul></ul><ul><ul><ul><li>user = User .find_by_email(mms.from) </li></ul></ul></ul><ul><ul><ul><li># store the body of the mms into a new BlogPost </li></ul></ul></ul><ul><ul><ul><li>blog_post = BlogPost .create(: body => mms.body, : user => user, </li></ul></ul></ul><ul><ul><ul><ul><li>: title => mms.subject) </li></ul></ul></ul></ul><ul><ul><ul><li># grab the attachment from the mms message </li></ul></ul></ul><ul><ul><ul><li>media = mms. default_media </li></ul></ul></ul><ul><ul><ul><li># store the attachment from mms into a BlogPhoto </li></ul></ul></ul><ul><ul><ul><li>BlogPhoto .create(: uploaded_data => media, : blog_post => blog_post) if </li></ul></ul></ul><ul><ul><ul><ul><li>media.content_type.include?(‘ image ’) </li></ul></ul></ul></ul><ul><ul><li>ensure </li></ul></ul><ul><ul><ul><li># cleans up temporary files used for text and attachments </li></ul></ul></ul><ul><ul><ul><li>mms.purge </li></ul></ul></ul><ul><ul><li>end </li></ul></ul><ul><li>end </li></ul><ul><li>end </li></ul>
    49. 52. <ul><li>require ‘ mms2r ’ </li></ul><ul><li>class MailReceiver < ActionMailer::Base </li></ul><ul><li>def receive (email) </li></ul><ul><li>begin </li></ul><ul><ul><ul><li># load the TMail object into an MMS2R::Media object </li></ul></ul></ul><ul><ul><ul><li>mms = MMS2R::Media .new(email) </li></ul></ul></ul><ul><ul><ul><li># grab a user on record by the e-mail it was sent from </li></ul></ul></ul><ul><ul><ul><li>user = User .find_by_email(mms.from) </li></ul></ul></ul><ul><ul><ul><li># store the body of the mms into a new BlogPost </li></ul></ul></ul><ul><ul><ul><li>blog_post = BlogPost .create(: body => mms.body, : user => user, </li></ul></ul></ul><ul><ul><ul><ul><li>: title => mms.subject) </li></ul></ul></ul></ul><ul><ul><ul><li># grab the attachment from the mms message </li></ul></ul></ul><ul><ul><ul><li>media = mms.default_media </li></ul></ul></ul><ul><ul><ul><li># store the attachment from mms into a BlogPhoto </li></ul></ul></ul><ul><ul><ul><li>BlogPhoto .create(: uploaded_data => media , : blog_post => blog_post) if media . content_type .include?(‘ image ’) </li></ul></ul></ul><ul><ul><li>ensure </li></ul></ul><ul><ul><ul><li># cleans up temporary files used for text and attachments </li></ul></ul></ul><ul><ul><ul><li>mms.purge </li></ul></ul></ul><ul><ul><li>end </li></ul></ul><ul><li>end </li></ul><ul><li>end </li></ul>
    50. 53. <ul><li>require ‘ mms2r ’ </li></ul><ul><li>class MailReceiver < ActionMailer::Base </li></ul><ul><li>def receive (email) </li></ul><ul><li>begin </li></ul><ul><ul><ul><li># load the TMail object into an MMS2R::Media object </li></ul></ul></ul><ul><ul><ul><li>mms = MMS2R::Media .new(email) </li></ul></ul></ul><ul><ul><ul><li># grab a user on record by the e-mail it was sent from </li></ul></ul></ul><ul><ul><ul><li>user = User .find_by_email(mms.from) </li></ul></ul></ul><ul><ul><ul><li># store the body of the mms into a new BlogPost </li></ul></ul></ul><ul><ul><ul><li>blog_post = BlogPost .create(: body => mms.body, : user => user, </li></ul></ul></ul><ul><ul><ul><ul><li>: title => mms.subject) </li></ul></ul></ul></ul><ul><ul><ul><li># grab the attachment from the mms message </li></ul></ul></ul><ul><ul><ul><li>media = mms.default_media </li></ul></ul></ul><ul><ul><ul><li># store the attachment from mms into a BlogPhoto </li></ul></ul></ul><ul><ul><ul><li>BlogPhoto .create(: uploaded_data => media, : blog_post => blog_post) if </li></ul></ul></ul><ul><ul><ul><ul><li>media.content_type.include?(‘ image ’) </li></ul></ul></ul></ul><ul><ul><li>ensure </li></ul></ul><ul><ul><ul><li># cleans up temporary files used for text and attachments </li></ul></ul></ul><ul><ul><ul><li>mms. purge </li></ul></ul></ul><ul><ul><li>end </li></ul></ul><ul><li>end </li></ul><ul><li>end </li></ul>
    51. 54. Adding new templates for carriers is easy <ul><li>--- </li></ul><ul><li>ignore: </li></ul><ul><li>   image / gif: </li></ul><ul><li>   - top.gif </li></ul><ul><li>   - bottom.gif </li></ul><ul><li>   - middle_img.gif </li></ul><ul><li>   text / html: </li></ul><ul><li>    - /< html > s +< head > s +< meta http - equiv = &quot;Content-Type </li></ul><ul><ul><li>&quot; content=&quot;text/html; charset=iso-8859-1&quot;>s+<title>MMS Email</title>/im </li></ul></ul><ul><li>transform: </li></ul><ul><li>   text / plain: </li></ul><ul><li>   - - / Note:s{1,2}. *? s + message:s{1,2}(. + )$ / m </li></ul><ul><li>     - &quot;1&quot; </li></ul>conf/mms.myhelio.com.yml
    52. 55. Mobilizing your Rails app is simple and easy
    53. 56. Mobile Fu http://github.com/brendanlim/mobile-fu/ Clickatell http://clickatell.rubyforge.org/ SMS Fu http://github.com/brendanlim/sms-fu/ MMS2R http://github.com/monde/mms2r/
    54. 57. Questions!

    ×