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
| <?php | |
| namespace Foo\Bar\Controller; | |
| class ModelController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController { | |
| /** | |
| * New action. | |
| * | |
| * Displays form in its current step. | |
| * | |
| * @param \Foo\Bar\Domain\Model\Model $model |
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
| [{"tid":24,"action":"Commands","method":"moveNodeAfterDestination","type":"rpc","result":{"serializeClassName":"TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode","id":"p23","type":"pages","editableText":"Test","text":"Test","cls":null,"prefix":"","suffix":"","qtip":"id=35 | |
| Verborgen","expanded":true,"expandable":false,"draggable":true,"isTarget":true,"spriteIconCode":" <\/span><\/span>","t3TextSourceField":"title","t3InCopyMode":false,"t3InCutMode":false,"t3ContextInfo":[],"editable":true,"allowChildren":true,"nodeData":{"serializeClassName":"TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode","id":"35","type":"pages","editableText":"Test","text":"Test","cls":null,"prefix":"","suffix":"","qtip":"id=35 | |
| Verborgen","expanded":true,"expandable":false,"draggable":true,"isTarget":true,"spriteIconCode":" <\/span><\/span>","t3TextSourceField":"title","t3InCopyMode":false,"t3InCutMode":false,"t3ContextInfo":[],"editable":true,"allowChildren":true,"readableRootline":"","mountPoint":0,"workspaceId":35,"isMountPoint":fals |
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 EnrollmentController < ApplicationController | |
| def new | |
| @users_assignments = [] | |
| 3.times{ @users_assignments << @event.assignments.build } | |
| end | |
| 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
| # Aim: load all activities having the same customer. | |
| # | |
| # PublicActivity::Activity(id: integer, trackable_id: integer, trackable_type: string, ...) | |
| # => belongs_to :trackable, polymorphic: true | |
| # => trackable is either Project or Service | |
| PublicActivity::Activity.joins(:trackable) | |
| # ActiveRecord::EagerLoadPolymorphicError: Can not eagerly load the polymorphic association :trackable |
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 CredentialsController < ApplicationController | |
| before_filter :assign_encryption_key | |
| before_filter :request_encryption_key, unless: "Credential.key_present?", except: [:set_encryption_key] | |
| def new | |
| @credential = Credential.new | |
| end | |
| def create |
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 MyGem | |
| module MyClassExtension | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| def does_something_to(modifiers = {}, *args) | |
| cattr_accessor :my_gem_modifiers | |
| self.my_gem_modifiers = modifiers | |
| end | |
| 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
| # in app/controllers/application_controller.rb | |
| require 'thing/exceptions' | |
| class ApplicationController < ActionController::Base | |
| 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
| # app/controllers/application_controller.rb | |
| class ApplicationController < ActionController::Base | |
| require 'myapp/exceptions' | |
| include MyApp::Exceptions | |
| end | |
| # config/application.rb | |
| module Myapp | |
| class Application < Rails::Application | |
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
| <header_images> | |
| <TCEforms type="array"> | |
| <config type="array"> | |
| <type>group</type> | |
| <internal_type>file</internal_type> | |
| <allowed>gif,png,jpg,jpeg</allowed> | |
| <max_size>1000</max_size> | |
| <uploadfolder>uploads/media</uploadfolder> | |
| <show_thumbs>5</show_thumbs> | |
| <size>5</size> |
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
| resources :recordings do | |
| get '/:year/:month/:day', :on => :collection, :action => :index, :constraints => {:day => /\D{1,2}/, :month => /\D{1,2}/, :year => /\D{4}/} | |
| end | |
| <%= link_to 'previous day', recordings_path(:year => (@date-1.day).year, :month => (@date-1.day).month, :day => (@date-1.day).day) %> | |
| # generates <a href="/recordings?year=yyy&month=mm&day=dd"> | |
| # desired: <a href="/recordings/yyyy/mm/dd"></a> |
NewerOlder