Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| # As used with CanCan and Devise | |
| class ApplicationController < ActionController::Base | |
| protect_from_forgery | |
| include ErrorResponseActions | |
| rescue_from CanCan::AccessDenied, :with => :authorization_error | |
| rescue_from ActiveRecord::RecordNotFound, :with => :resource_not_found | |
| before_filter :authenticate! |
| #!/bin/sh | |
| PROJECT="" # Fill this in | |
| IMAGES="$PROJECT/app/assets/images" | |
| VIEWS="$PROJECT/app/views" | |
| CSS="$PROJECT/app/assets/stylesheets" | |
| for image in `find $IMAGES -type f` | |
| do | |
| name=`basename $image` |
| SingletonClass.h: | |
| @interface SingletonClass : NSObject | |
| @property (nonatomic, retain) NSString *myProperty; | |
| + (SingletonClass *)sharedInstance; | |
| @end | |
| SingletonClass.m: | |
| @implentation | |
| + (SingletonClass *)sharedInstance |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| gem 'kaminari' | |
| gem 'ransack' |
| # config/initializers/active_admin.rb | |
| ActiveAdmin.setup do |config| | |
| config.current_user_method = :current_user | |
| config.authentication_method = :authenticate_user! | |
| config.before_filter :admin_role_filter | |
| end | |
| # Adding all recource names to Permissions table after ActiveAdmin is loaded |
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |