This guide will show you how to:
- configure and use Refinery::Pages::MenuPresenter
- use a decorator to add a custom method to Refinery::Page class
endprologue.
# app/decorators/controllers/refinery/pages_controller_decorator.rb | |
Refinery::PagesController.class_eval do | |
before_filter :error_404, :unless => :current_user_can_view_page?, :only => :home | |
end |
# Rails 2, 3, 4, and Hanami console | |
function rc { | |
if [ -e "./script/console" ]; then | |
./script/console $@ | |
elif [ -e "./bin/rails" ]; then | |
./bin/rails console $@ | |
elif [ -e "./apps" ]; then | |
hanami console $@ | |
else | |
script/rails console $@ |
04:52:02: [master±|2.0.0p0] /code/parndt/forem$ rake forem:dummy_app | |
rake aborted! | |
You have already activated rake 10.0.4, but your Gemfile requires rake 10.0.3. Using bundle exec may solve this. | |
04:52:04: [master±|2.0.0p0] /code/parndt/forem$ bundle exec !! | |
bundle exec rake forem:dummy_app | |
Copying over Forem migrations... # success |
- if local_assigns[:mass_moderation] | |
= render '/forem/posts/moderation_tools', :post => post | |
- else | |
= form_tag forem.forum_moderate_posts_path(post.topic.forum), :method => :put do | |
= render '/forem/posts/moderation_tools', :post => post |
<div id='forums_container'> | |
<h1 id='forums_title'><%= t('.title') %></h1> | |
<%= render @categories %> | |
</div> | |
<br> | |
<footer id='admin_link'> | |
<% if forem_admin? %> | |
<%= link_to t("area", :scope => "forem.admin"), forem.admin_root_path %> |
#!/usr/bin/env ruby | |
spec_hits = [] | |
checks = { | |
'_spec\.rb$' => ['focus:[:space:]*true'], | |
'\.rb$' => ['binding\.pry', 'debugger'] | |
} | |
# Find the names of all the filenames that have been (A)dded (C)opied or (M)odified | |
filenames = `git diff --cached --name-only --diff-filter=ACM`.split("\n") |
<div id="slider"> | |
<!--<img src="images/image1.jpg" alt="image1"/> | |
<a href="#link"><img src="images/image2.jpg" alt="image2"/></a> | |
<img src="images/image3.jpg" alt="image3"/> | |
<img src="images/image4.jpg" alt="image4"/> | |
</div>--> | |
<%= image_tag 'Composite1.png', { :alt => 1 } %> | |
<%= image_tag 'Composite2.png', { :alt => 2 } %> | |
<%= image_tag 'Composite15.png', { :alt => 15 } %> | |
<%= image_tag 'Composite14.png', { :alt => 14 } %> |
class PromotionAttachment < ActiveRecord::Base | |
belongs_to :promotion | |
attr_accessible :like_gate_image, :promotion_image, :app_icon, :video_url | |
validate :validate_like_gate_image_dimensions | |
[:like_gate_image, :promotion_image].each do |file_name| | |
options = { | |
styles: { |
module Refinery | |
module PhotoGallery | |
module Extensions | |
module Pages | |
def has_one_page_album | |
has_many :album_page, :as => :page, :dependent=> :destroy | |
has_many :album, :through => :album_page | |
has_many :photos, :class_name => Refinery::PhotoGallery::Photo, :through => :album , :order => "created_at ASC" | |