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
class PostsController < ApplicationController | |
respond_to :html, :xml, :json | |
# GET /posts | |
# GET /posts.xml | |
def index | |
@posts = Post.paginate :page => params[:page] | |
respond_with @posts do |format| | |
format.atom | |
end |
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
module ActionView | |
module Helpers | |
module FormHelper | |
alias :text_field_without_inputmode :text_field | |
# ==== Options | |
# * <tt>:inputmode</tt> - 入力モード。Jpmobile::InputMode::HIRAGANA-全角ひらがな、Jpmobile::InputMode::HANKAKUKANA-半角カナ、Jpmobile::InputMode::ALPHABET-半角英字、Jpmobile::InputMode::NUMERIC-半角数字 | |
# ==== Examples | |
# text_field_tag(:user, :name, :size => 20, :inputmode => Jpmobile::InputMode::HIRAGANA) | |
# # => <input id="name" name="name" type="text" size="20" istyle="1" style="-wap-input-format:"<ja:h>""> |
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
# Para salvar a altura e largura das imagens enviadas pelo plugin paperclip, utilize o callback abaixo | |
# | |
# class Document < ActiveRecord::Base | |
# | |
# has_attached_file :document, :styles => { :medium => "300x300>" } | |
# | |
# before_save :save_dimensions | |
# | |
# def save_dimensions | |
# if document.image? |
NewerOlder