This file contains hidden or 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
<h1>International Telephone Input - BOOTSTRAP INPUT GROUP</h1> | |
<form> | |
<div class="input-group"> | |
<input type="tel" class="form-control"> | |
<span class="input-group-addon">Tel</span> | |
</div> | |
<br> | |
<div class="input-group"> | |
<input type="tel" class="form-control"> | |
<span class="input-group-addon">Tel</span> |
This file contains hidden or 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
let states = [ | |
"Andhra Pradesh", | |
"Arunachal Pradesh", | |
"Assam", | |
"Bihar", | |
"Chhattisgarh", | |
"Goa", | |
"Gujarat", | |
"Haryana", | |
"Himachal Pradesh", |
This file contains hidden or 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
# Ran into an issue recently where I wanted to use our custom prawn class to generate a PDF, then upload it to Amazon S3 using paperclip. | |
# Let 'OurCustomPdf' be our prawn class. | |
# Let the variable '@user' be our our model, has_many :documents | |
# Let 'Document' be our paperclip model, belongs_to :user | |
pdf = OurCustomPdf.new(@user, "pdf") | |
upload = @user.documents.new | |
upload.attachment = StringIO.new(pdf.render) | |
upload.save! | |
This file contains hidden or 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
// https://codepen.io/hartzis/pen/VvNGZP | |
class ImageUpload extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
file: '', | |
imagePreviewUrl: '' | |
}; | |
this._handleImageChange = this._handleImageChange.bind(this); | |
this._handleSubmit = this._handleSubmit.bind(this); |