Module: CloudinaryHelper
- Includes:
- ActionView::Helpers::CaptureHelper, Responsive
- Defined in:
- lib/cloudinary/helper.rb,
lib/cloudinary/video_helper.rb,
lib/active_storage/service/cloudinary_service.rb
Constant Summary collapse
- CL_BLANK =
"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
- CLOUDINARY_JS_CONFIG_PARAMS =
[:api_key, :cloud_name, :private_cdn, :secure_distribution, :cdn_subdomain]
- DEFAULT_POSTER_OPTIONS =
{ :format => 'jpg', :resource_type => 'video' }
- DEFAULT_SOURCE_TYPES =
%w(webm mp4 ogv)
- DEFAULT_VIDEO_OPTIONS =
{ :resource_type => 'video' }
- DEFAULT_SOURCES =
[ { :type => "mp4", :codecs => "hev1", :transformations => { :video_codec => "h265" } }, { :type => "webm", :codecs => "vp9", :transformations => { :video_codec => "vp9" } }, { :type => "mp4", :transformations => { :video_codec => "auto" } }, { :type => "webm", :transformations => { :video_codec => "auto" } } ]
Class Method Summary collapse
Instance Method Summary collapse
- #cl_blank ⇒ Object
- #cl_client_hints_meta_tag ⇒ Object
- #cl_download_archive_url(options = {}) ⇒ Object
- #cl_download_zip_url(options = {}) ⇒ Object
-
#cl_form_tag(callback_url, options = {}, &block) ⇒ Object
cl_form_tag was originally contributed by Milovan Zogovic.
-
#cl_image_path(source, options = {}) ⇒ Object
(also: #cl_path)
Works similarly to cl_image_tag, however just generates the URL of the image.
-
#cl_image_tag(source, options = {}) ⇒ Object
Stand-in for Rails image_tag helper that accepts various options for transformations.
- #cl_image_upload(object_name, method, options = {}) ⇒ Object (also: #cl_upload)
- #cl_image_upload_tag(field, options = {}) ⇒ Object (also: #cl_upload_tag)
- #cl_picture_tag(source, options = {}, sources = []) ⇒ Object
- #cl_private_download_url(public_id, format, options = {}) ⇒ Object
- #cl_signed_download_url(public_id, options = {}) ⇒ Object
- #cl_source_tag(source, options) ⇒ Object
- #cl_sprite_tag(source, options = {}) ⇒ Object
- #cl_sprite_url(source, options = {}) ⇒ Object
- #cl_unsigned_image_upload(object_name, method, upload_preset, options = {}) ⇒ Object (also: #cl_unsigned_upload)
- #cl_unsigned_image_upload_tag(field, upload_preset, options = {}) ⇒ Object (also: #cl_unsigned_upload_tag)
- #cl_upload_tag_params(options = {}) ⇒ Object
- #cl_upload_url(options = {}) ⇒ Object
-
#cl_video_path(source, options = {}) ⇒ Object
Returns a url for the given source with
options
. -
#cl_video_tag(source, options = {}, &block) ⇒ Object
Creates an HTML video tag for the provided
source
. -
#cl_video_thumbnail_path(source, options = {}) ⇒ Object
Returns a url for the thumbnail for the given video
source
andoptions
. -
#cl_video_thumbnail_tag(source, options = {}) ⇒ Object
Returns an HTML
img
tag with the thumbnail for the given videosource
andoptions
. - #cloudinary_js_config ⇒ Object
- #cloudinary_tag(source, options = {}) ⇒ Object
- #cloudinary_url(source, options = {}) ⇒ Object
- #cloudinary_url_internal(source, options = {}) ⇒ Object
- #cloudinary_url_internal_original ⇒ Object
- #facebook_profile_image_path(profile, options = {}) ⇒ Object
- #facebook_profile_image_tag(profile, options = {}) ⇒ Object
- #fetch_image_tag(profile, options = {}) ⇒ Object
- #gplus_profile_image_path(profile, options = {}) ⇒ Object
- #gplus_profile_image_tag(profile, options = {}) ⇒ Object
- #gravatar_profile_image_path(email, options = {}) ⇒ Object
- #gravatar_profile_image_tag(email, options = {}) ⇒ Object
- #image_path_with_cloudinary(*args) ⇒ Object
- #image_tag_with_cloudinary(*args) ⇒ Object
- #twitter_name_profile_image_path(profile, options = {}) ⇒ Object
- #twitter_name_profile_image_tag(profile, options = {}) ⇒ Object
- #twitter_profile_image_path(profile, options = {}) ⇒ Object
- #twitter_profile_image_tag(profile, options = {}) ⇒ Object
Methods included from Responsive
#generate_breakpoints, #generate_image_responsive_attributes, #generate_media_attribute, #generate_scaled_url, #generate_sizes_attribute, #generate_srcset_attribute, #get_or_generate_breakpoints
Class Method Details
.included(base) ⇒ Object
303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/cloudinary/helper.rb', line 303 def self.included(base) ActionView::Helpers::FormBuilder.send(:include, Cloudinary::FormBuilder) base.class_eval do unless method_defined?(:image_tag) include ActionView::Helpers::AssetTagHelper end alias_method :image_tag_without_cloudinary, :image_tag unless public_method_defined? :image_tag_without_cloudinary alias_method :image_path_without_cloudinary, :image_path unless public_method_defined? :image_path_without_cloudinary if Cloudinary.config.enhance_image_tag alias_method :image_tag, :image_tag_with_cloudinary alias_method :image_path, :image_path_with_cloudinary end end end |
Instance Method Details
#cl_blank ⇒ Object
110 111 112 |
# File 'lib/cloudinary/helper.rb', line 110 def cl_blank CL_BLANK end |
#cl_client_hints_meta_tag ⇒ Object
232 233 234 |
# File 'lib/cloudinary/helper.rb', line 232 def tag "meta", "http-equiv" => "Accept-CH", :content => "DPR, Viewport-Width, Width" end |
#cl_download_archive_url(options = {}) ⇒ Object
290 291 292 |
# File 'lib/cloudinary/helper.rb', line 290 def cl_download_archive_url( = {}) Cloudinary::Utils.download_archive_url() end |
#cl_download_zip_url(options = {}) ⇒ Object
295 296 297 |
# File 'lib/cloudinary/helper.rb', line 295 def cl_download_zip_url( = {}) Cloudinary::Utils.download_zip_url() end |
#cl_form_tag(callback_url, options = {}, &block) ⇒ Object
cl_form_tag was originally contributed by Milovan Zogovic
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/cloudinary/helper.rb', line 196 def cl_form_tag(callback_url, ={}, &block) = .delete(:form) || {} [:method] = :post [:multipart] = true params = Cloudinary::Uploader.build_upload_params(.merge(:callback=>callback_url)) params[:signature] = Cloudinary::Utils.api_sign_request(params, Cloudinary.config.api_secret) params[:api_key] = Cloudinary.config.api_key api_url = Cloudinary::Utils.cloudinary_api_url("upload", {:resource_type => .delete(:resource_type), :upload_prefix => .delete(:upload_prefix)}) form_tag(api_url, ) do content = [] params.each do |name, value| content << hidden_field_tag(name, value, :id => nil) if value.present? end content << capture(&block) content.join("\n").html_safe end end |
#cl_image_path(source, options = {}) ⇒ Object Also known as: cl_path
Works similarly to cl_image_tag, however just generates the URL of the image
115 116 117 118 119 |
# File 'lib/cloudinary/helper.rb', line 115 def cl_image_path(source, = {}) = .clone url = cloudinary_url_internal(source, ) image_path_without_cloudinary(url) end |
#cl_image_tag(source, options = {}) ⇒ Object
Stand-in for Rails image_tag helper that accepts various options for transformations.
- source
-
the public ID, possibly with a file type extension. If there is no extension, the :format option is expected to indicate what the extension is. This value can contain the version, or not.
- options
-
Options you would normally pass to image_tag as well as Cloudinary-specific options to control the transformation. Depending on what options are provided, the generated URL may or may not have Cloudinary-specific details in it. For example, if you only specify :width and :height, these values will not be sent to Cloudinary, however if you also specify :crop, they will be.
Examples
# Image tag sized by the browser, not Cloudinary
cl_image_tag "sample.png", :width=>100, :height=>100, :alt=>"hello" # W/H are not sent to Cloudinary
# Image tag sized by Cloudinary using the :fit crop strategy
cl_image_tag "sample.png", :width=>100, :height=>100, :alt=>"hello", :crop=>:fit # W/H are sent to Cloudinary
Get a url for the image with the public id "sample", in :png format.
cl_image_tag "sample", format: :png
See documentation for more details and options: cloudinary.com/documentation/rails_image_manipulation
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/cloudinary/helper.rb', line 33 def cl_image_tag(source, = {}) cloudinary_tag source, do |source, | if source image_tag_without_cloudinary(source, ) else tag 'img', end end end |
#cl_image_upload(object_name, method, options = {}) ⇒ Object Also known as: cl_upload
239 240 241 |
# File 'lib/cloudinary/helper.rb', line 239 def cl_image_upload(object_name, method, ={}) cl_image_upload_tag("#{object_name}[#{method}]", ) end |
#cl_image_upload_tag(field, options = {}) ⇒ Object Also known as: cl_upload_tag
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/cloudinary/helper.rb', line 262 def cl_image_upload_tag(field, ={}) = .delete(:html) || {} if .delete(:multiple) [:multiple] = true field = "#{ field }[]" unless field.to_s[-2..-1] == "[]" end = .merge(:type=>"file", :name=>"file", :"data-url"=>cl_upload_url(), :"data-form-data"=>cl_upload_tag_params(), :"data-cloudinary-field"=>field, :"data-max-chunk-size"=>[:chunk_size], :"class" => [[:class], "cloudinary-fileupload"].flatten.compact ).reject{|k,v| v.blank?} tag("input", ) end |
#cl_picture_tag(source, options = {}, sources = []) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cloudinary/helper.rb', line 45 def cl_picture_tag(source, = {}, sources =[]) = .clone content_tag 'picture' do sources.map do |source_def| = .clone = Cloudinary::Utils.chain_transformation(, source_def[:transformation]) [:media] = source_def cl_source_tag(source, ) end.push(cl_image_tag(source, )) .join('') .html_safe end end |
#cl_private_download_url(public_id, format, options = {}) ⇒ Object
285 286 287 |
# File 'lib/cloudinary/helper.rb', line 285 def cl_private_download_url(public_id, format, = {}) Cloudinary::Utils.private_download_url(public_id, format, ) end |
#cl_signed_download_url(public_id, options = {}) ⇒ Object
299 300 301 |
# File 'lib/cloudinary/helper.rb', line 299 def cl_signed_download_url(public_id, = {}) Cloudinary::Utils.cloudinary_url(public_id, ) end |
#cl_source_tag(source, options) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/cloudinary/helper.rb', line 60 def cl_source_tag(source, ) srcset_param = .fetch(:srcset, {}).merge(Cloudinary.config.srcset || {}) attributes = .fetch(:attributes, {}).clone responsive_attributes = generate_image_responsive_attributes(source, attributes, srcset_param, ) attributes = attributes.merge(responsive_attributes) unless attributes.has_key? :srcset attributes[:srcset] = Cloudinary::Utils.cloudinary_url(source, ) end media_attr = generate_media_attribute([:media]) attributes[:media] = media_attr unless media_attr.empty? tag "source", attributes, true end |
#cl_sprite_tag(source, options = {}) ⇒ Object
191 192 193 |
# File 'lib/cloudinary/helper.rb', line 191 def cl_sprite_tag(source, = {}) stylesheet_link_tag(cl_sprite_url(source, )) end |
#cl_sprite_url(source, options = {}) ⇒ Object
176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/cloudinary/helper.rb', line 176 def cl_sprite_url(source, = {}) = .clone version_store = .delete(:version_store) if [:version].blank? && (version_store == :file) && defined?(Rails) && defined?(Rails.root) file_name = "#{Rails.root}/tmp/cloudinary/cloudinary_sprite_#{source.sub(/\..*/, '')}.version" if File.exist?(file_name) [:version] = File.read(file_name).chomp end end [:format] = "css" unless source.ends_with?(".css") cloudinary_url_internal(source, .merge(:type=>:sprite)) end |
#cl_unsigned_image_upload(object_name, method, upload_preset, options = {}) ⇒ Object Also known as: cl_unsigned_upload
243 244 245 |
# File 'lib/cloudinary/helper.rb', line 243 def cl_unsigned_image_upload(object_name, method, upload_preset, ={}) cl_unsigned_image_upload_tag("#{object_name}[#{method}]", upload_preset, ) end |
#cl_unsigned_image_upload_tag(field, upload_preset, options = {}) ⇒ Object Also known as: cl_unsigned_upload_tag
280 281 282 |
# File 'lib/cloudinary/helper.rb', line 280 def cl_unsigned_image_upload_tag(field, upload_preset, ={}) cl_image_upload_tag(field, .merge(:unsigned => true, :upload_preset => upload_preset)) end |
#cl_upload_tag_params(options = {}) ⇒ Object
252 253 254 255 256 257 258 259 260 |
# File 'lib/cloudinary/helper.rb', line 252 def cl_upload_tag_params(={}) cloudinary_params = Cloudinary::Uploader.build_upload_params() cloudinary_params[:callback] = build_callback_url() if [:unsigned] return cloudinary_params.reject{|k, v| Cloudinary::Utils.safe_blank?(v)}.to_json else return Cloudinary::Utils.sign_request(cloudinary_params, ).to_json end end |
#cl_upload_url(options = {}) ⇒ Object
248 249 250 |
# File 'lib/cloudinary/helper.rb', line 248 def cl_upload_url(={}) Cloudinary::Utils.cloudinary_api_url("upload", {:resource_type=>:auto}.merge()) end |
#cl_video_path(source, options = {}) ⇒ Object
Returns a url for the given source with options
93 94 95 |
# File 'lib/cloudinary/video_helper.rb', line 93 def cl_video_path(source, ={}) cl_image_path(source, DEFAULT_VIDEO_OPTIONS.merge()) end |
#cl_video_tag(source, options = {}, &block) ⇒ Object
Creates an HTML video tag for the provided source
Options
-
:source_types
- Specify which source type the tag should include. defaults to webm, mp4 and ogv. -
:source_transformation
- specific transformations to use for a specific source type. -
:sources
- list of sources (overrides :source_types when present) -
:poster
- override default thumbnail:-
url: provide an ad hoc url
-
options: with specific poster transformations and/or Cloudinary
:public_id
-
Examples
cl_video_tag("mymovie.mp4")
cl_video_tag("mymovie.mp4", :source_types => :webm)
cl_video_tag("mymovie.ogv", :poster => "myspecialplaceholder.jpg")
cl_video_tag("mymovie.webm", :source_types => [:webm, :mp4], :poster => {:effect => 'sepia'}) do
content_tag( :span, "Cannot present video!")
end
cl_video_tag("mymovie", :sources => [
{
:type => "mp4",
:codecs => "hev1",
:transformations => { :video_codec => "h265" }
},
{
:type => "webm",
:transformations => { :video_codec => "auto" }
}
])
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/cloudinary/video_helper.rb', line 55 def cl_video_tag(source, = {}, &block) source = strip_known_ext(source) unless Cloudinary::Utils.config_option_fetch(, :use_fetch_format) video_attributes = [:autoplay,:controls,:loop,:muted,:poster, :preload] = Cloudinary::Utils.deep_symbolize_keys(DEFAULT_VIDEO_OPTIONS.merge()) [:source_types] ||= DEFAULT_SOURCE_TYPES video_attributes.keep_if{ |key, _| .has_key?(key)} # required prior to Rails 4.x = .extract!(*video_attributes) if .has_key? :poster poster = .delete(:poster) case poster when String [:poster] = poster when Hash if poster.has_key? :public_id poster[:resource_type] = "image" poster_name = poster[:public_id] [:poster] = cl_image_path(poster_name, poster) else [:poster] = cl_video_thumbnail_path(source, poster) end else # no poster end else [:poster] = cl_video_thumbnail_path(source, ) end fallback = (capture(&block) if block_given?) || .delete(:fallback_content) if [:sources] video_tag_from_sources(source, , , fallback) else video_tag_from_source_types(source, , , fallback) end end |
#cl_video_thumbnail_path(source, options = {}) ⇒ Object
Returns a url for the thumbnail for the given video source
and options
103 104 105 |
# File 'lib/cloudinary/video_helper.rb', line 103 def cl_video_thumbnail_path(source, ={}) cl_image_path(source, DEFAULT_POSTER_OPTIONS.merge()) end |
#cl_video_thumbnail_tag(source, options = {}) ⇒ Object
Returns an HTML img
tag with the thumbnail for the given video source
and options
98 99 100 |
# File 'lib/cloudinary/video_helper.rb', line 98 def cl_video_thumbnail_tag(source, ={}) cl_image_tag(source, DEFAULT_POSTER_OPTIONS.merge()) end |
#cloudinary_js_config ⇒ Object
222 223 224 225 226 227 228 229 230 |
# File 'lib/cloudinary/helper.rb', line 222 def cloudinary_js_config params = {} CLOUDINARY_JS_CONFIG_PARAMS.each do |param| value = Cloudinary.config.send(param) params[param] = value if !value.nil? end content_tag("script", "$.cloudinary.config(#{params.to_json});".html_safe, :type=>"text/javascript") end |
#cloudinary_tag(source, options = {}) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/cloudinary/helper.rb', line 74 def cloudinary_tag(source, = {}) = .clone [:width] = .delete(:html_width) if .include?(:html_width) [:height] = .delete(:html_height) if .include?(:html_height) [:size] = .delete(:html_size) if .include?(:html_size) [:border] = .delete(:html_border) if .include?(:html_border) srcset_param = Cloudinary::Utils.config_option_consume(, :srcset, {}) src = cloudinary_url_internal(source, ) attributes = .delete(:attributes) || {} responsive_placeholder = Cloudinary::Utils.config_option_consume(, :responsive_placeholder) client_hints = Cloudinary::Utils.config_option_consume(, :client_hints) hidpi = .delete(:hidpi) responsive = .delete(:responsive) if !client_hints && (hidpi || responsive) ["data-src"] = src src = nil extra_class = responsive ? "cld-responsive" : "cld-hidpi" [:class] = [[:class], extra_class].compact.join(" ") responsive_placeholder = CL_BLANK if responsive_placeholder == "blank" [:src] = responsive_placeholder end responsive_attrs = generate_image_responsive_attributes(source, attributes, srcset_param, ) unless responsive_attrs.empty? .delete(:width) .delete(:height) .merge! responsive_attrs end if block_given? yield(src,) else tag('div', ) end end |
#cloudinary_url(source, options = {}) ⇒ Object
235 236 237 |
# File 'lib/cloudinary/helper.rb', line 235 def cloudinary_url(source, = {}) cloudinary_url_internal(source, .clone) end |
#cloudinary_url_internal(source, options = {}) ⇒ Object
320 321 322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/cloudinary/helper.rb', line 320 def cloudinary_url_internal(source, = {}) if defined?(CarrierWave::Uploader::Base) && source.is_a?(CarrierWave::Uploader::Base) if source.version_name.present? [:transformation] = Cloudinary::Utils.build_array(source.transformation) + Cloudinary::Utils.build_array([:transformation]) end .reverse_merge!( :resource_type => Cloudinary::Utils.resource_type_for_format(source.filename || source.format), :type => source.storage_type, :format => source.format) source = source.full_public_id end Cloudinary::Utils.cloudinary_url(source, ) end |
#cloudinary_url_internal_original ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/active_storage/service/cloudinary_service.rb', line 17 def cloudinary_url_internal(source, = {}) if defined?(CarrierWave::Uploader::Base) && source.is_a?(CarrierWave::Uploader::Base) if source.version_name.present? [:transformation] = Cloudinary::Utils.build_array(source.transformation) + Cloudinary::Utils.build_array([:transformation]) end .reverse_merge!( :resource_type => Cloudinary::Utils.resource_type_for_format(source.filename || source.format), :type => source.storage_type, :format => source.format) source = source.full_public_id end Cloudinary::Utils.cloudinary_url(source, ) end |
#facebook_profile_image_path(profile, options = {}) ⇒ Object
140 141 142 |
# File 'lib/cloudinary/helper.rb', line 140 def facebook_profile_image_path(profile, = {}) cl_image_path(profile, {:type=>:facebook}.merge()) end |
#facebook_profile_image_tag(profile, options = {}) ⇒ Object
136 137 138 |
# File 'lib/cloudinary/helper.rb', line 136 def facebook_profile_image_tag(profile, = {}) cl_image_tag(profile, {:type=>:facebook}.merge()) end |
#fetch_image_tag(profile, options = {}) ⇒ Object
132 133 134 |
# File 'lib/cloudinary/helper.rb', line 132 def fetch_image_tag(profile, = {}) cl_image_tag(profile, {:type=>:fetch}.merge()) end |
#gplus_profile_image_path(profile, options = {}) ⇒ Object
172 173 174 |
# File 'lib/cloudinary/helper.rb', line 172 def gplus_profile_image_path(profile, = {}) cl_image_path(profile, {:type=>:gplus}.merge()) end |
#gplus_profile_image_tag(profile, options = {}) ⇒ Object
168 169 170 |
# File 'lib/cloudinary/helper.rb', line 168 def gplus_profile_image_tag(profile, = {}) cl_image_tag(profile, {:type=>:gplus}.merge()) end |
#gravatar_profile_image_path(email, options = {}) ⇒ Object
148 149 150 |
# File 'lib/cloudinary/helper.rb', line 148 def gravatar_profile_image_path(email, = {}) cl_image_path(Digest::MD5.hexdigest(email.strip.downcase), {:type=>:gravatar, :format=>:jpg}.merge()) end |
#gravatar_profile_image_tag(email, options = {}) ⇒ Object
144 145 146 |
# File 'lib/cloudinary/helper.rb', line 144 def gravatar_profile_image_tag(email, = {}) cl_image_tag(Digest::MD5.hexdigest(email.strip.downcase), {:type=>:gravatar, :format=>:jpg}.merge()) end |
#image_path_with_cloudinary(*args) ⇒ Object
127 128 129 130 |
# File 'lib/cloudinary/helper.rb', line 127 def image_path_with_cloudinary(*args) source, = args cl_image_path(source, {:type=>:asset}.merge( || {})) end |
#image_tag_with_cloudinary(*args) ⇒ Object
122 123 124 125 |
# File 'lib/cloudinary/helper.rb', line 122 def image_tag_with_cloudinary(*args) source, = args cl_image_tag(source, {:type=>:asset}.merge( || {})) end |
#twitter_name_profile_image_path(profile, options = {}) ⇒ Object
164 165 166 |
# File 'lib/cloudinary/helper.rb', line 164 def twitter_name_profile_image_path(profile, = {}) cl_image_path(profile, {:type=>:twitter_name}.merge()) end |
#twitter_name_profile_image_tag(profile, options = {}) ⇒ Object
160 161 162 |
# File 'lib/cloudinary/helper.rb', line 160 def twitter_name_profile_image_tag(profile, = {}) cl_image_tag(profile, {:type=>:twitter_name}.merge()) end |
#twitter_profile_image_path(profile, options = {}) ⇒ Object
156 157 158 |
# File 'lib/cloudinary/helper.rb', line 156 def twitter_profile_image_path(profile, = {}) cl_image_path(profile, {:type=>:twitter}.merge()) end |
#twitter_profile_image_tag(profile, options = {}) ⇒ Object
152 153 154 |
# File 'lib/cloudinary/helper.rb', line 152 def twitter_profile_image_tag(profile, = {}) cl_image_tag(profile, {:type=>:twitter}.merge()) end |