This file contains 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
require 'ostruct' | |
class MyForm < OpenStruct | |
include ActiveModel::Validations | |
include ActiveModel::Conversion | |
extend ActiveModel::Naming | |
validates :name, :presence => true | |
def initialize(*args) | |
super |
This file contains 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
<% @my_form.render do |f| # custom form %> | |
<div class="firstname"><%= f.firstname # maybe options are possible here %></div> | |
<div class="text"><%= f.text %></div> | |
<% end %> | |
<%= @my_form.render # no customization %> |
This file contains 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
<main> | |
<nav> | |
<link to="">somewhere</link> | |
link to="">somewhere</link> | |
link to="">somewhere</link> | |
</nav> | |
<section type="blog"> | |
<post author="" date=""> | |
Lorem ipsum | |
</post> |
This file contains 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
<link rel="import" href="../components/polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
#core_scaffold { | |
position: absolute; | |
top: 0px; | |
right: 0px; |
This file contains 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
results = [] | |
for (i in res.guests){ | |
model = { | |
name: res.guests[i].name | |
}; | |
Object.defineProperties(model, { | |
'reversename': { |
This file contains 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
<ui-panel> | |
<div class="panel-heading"> | |
Title here | |
</div> | |
<div class="panel-body" style="height:200px"> | |
.... | |
</div> | |
<div class="panel-footer clearfix"> | |
Footer | |
</div> |
This file contains 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 $contain = array( | |
'Module' => array( | |
'Question' => array( | |
'Answer', | |
'order' => 'RAND()', | |
'limit' => 15 | |
), | |
'order' => array('order','name') | |
) | |
); |
This file contains 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
def update | |
@company = Company.find(params[:id]) | |
# @company.user = current_user | |
@company.projects.each do |p| | |
if p.user.nil? | |
p.user = current_user | |
end | |
end |
This file contains 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
<div class="root-box"> | |
<h1><%= link_to 'Companies', companies_path %></h1> | |
<div class="company-box"> | |
<h1><%= h @company.name %></h1> | |
<% if !@company.user.nil? %> | |
<h2><%= h @company.user.username %></h2> | |
<% end %> | |
<%= link_to 'Edit', edit_company_path(@company) %> |
This file contains 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 | |
/** | |
* | |
* PHP versions 4 and 5 | |
* | |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | |
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) | |
* | |
* Licensed under The MIT License | |
* Redistributions of files must retain the above copyright notice. |
OlderNewer