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
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
def after_sign_in_path_for(resource_or_scope) | |
if current_user.sign_in_count == 1 | |
new_when_path | |
else | |
root_path | |
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
http://localhost:3000/locate/12/06/12/2012 returns as 2012-12-06 | |
WANT IT TO RETURN AS | |
06-12-2012 | |
======CONTROLLER==== |
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
This is the data i want ot use | |
{ | |
"device":118, | |
"events":[{ | |
"exampleentry":7, | |
"exampleentry":118, | |
"exampleentry":13 | |
"exampleentry":xxx, | |
"location":{ |
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
/*Kitchen Sink App*/ | |
/*shows number of texts sent in serial monitor*/ | |
// libraries | |
#include <GSM3SMSService.h> | |
#include <GSM3ShieldV1AccessProvider.h> | |
#include <GSM3ShieldV1ClientProvider.h> | |
#include <GSM3ShieldV1SMSProvider.h> | |
#include <GSM3MobileClientService.h> |
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
/*Kitchen Sink App*/ | |
// libraries | |
#include <GSM3SMSService.h> | |
#include <GSM3ShieldV1AccessProvider.h> | |
#include <GSM3ShieldV1ClientProvider.h> | |
#include <GSM3ShieldV1SMSProvider.h> | |
#include <GSM3ShieldV1DataNetworkProvider.h> | |
#include <GSM3MobileClientService.h> |
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
// (c) Copyright 2010-2011 MCQN Ltd. | |
// Released under Apache License, version 2.0 | |
// | |
// Simple example to show how to use the HttpClient library | |
// Get's the web page given at http://<kHostname><kPath> and | |
// outputs the content to the serial port | |
// The example is adapted to run on the GSM/GPRS shield | |
// in asynchronous mode | |
// | |
// Circuit: |
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
// (c) Copyright 2010-2011 MCQN Ltd. | |
// Released under Apache License, version 2.0 | |
// | |
// Simple example to show how to use the HttpClient library | |
// Get's the web page given at http://<kHostname><kPath> and | |
// outputs the content to the serial port | |
// The example is adapted to run on the GSM/GPRS shield | |
// in asynchronous mode | |
// | |
// Circuit: |
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
/* | |
ReadAnalogVoltage | |
Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor. | |
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground. | |
This example code is in the public domain. | |
*/ | |
// the setup routine runs once when you press reset: | |
void setup() { |
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
Trying to get it to display hello if the minutes are set to 23 in the controller. (Not sure of doing it right) | |
index.html.erb | |
<% if @minutes == 23 %> | |
<%= "helllo" %> | |
<% else %> |
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
def index | |
@minutes = params[:minutes] | |
@minutes = 500 | |
if minutes <= 500 | |
p "you have used under 500 minutes" | |
else | |
p "you have used over 500 minutes" | |
end | |
end |