class DealsController < ApplicationController
before_filter :authenticate_user!, except: [:index, :show, :list]
before_filter :authenticate_proposer, only: [:edit]
rescue_from StandardError, with: :show_errors
rescue_from Order::OrderNotFound, with: :show_errors
##Ruby (Rails) tips
####1. Array Initialization
if x.is_a?(Array)
x.each { |x| puts x }
else
puts x
end
- Star Rating with only CSS
<div class="star-wrapper">
<a class="star" href="javascript:alert(1)"></a>
<div class="star-wrapper">
<a class="star"></a>
<div class="star-wrapper">
<a class="star"></a>
<div class="star-wrapper">
Setup a WYSIWYG editor with CKEditor. Includes instruction for Rails_Admin
- Add
gem 'ckeditor'
to your Gemfile and bundle - Checkout https://github.com/galetahub/ckeditor for instruction to generate the correct model to generate for uploading of files (eg. ActiveRecord + Paperclip)
- Run
rake db:migrate
- Add
//= require ckeditor/override
in your application.js (before require_tree .)
To configure the editor to be used in Rails_Admin, follow this https://github.com/sferik/rails_admin/wiki/CKEditor
OlderNewer