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 | |
class AccessComponent extends Object { | |
public $settings = array(); | |
public $defaults = array( | |
'admin_required' => array(), | |
'auth_denied' => array(), | |
'auth_required' => array(), | |
'denied' => array(), | |
'callback' => 'initialize'); |
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
class CreateContentelements < ActiveRecord::Migration | |
def self.up | |
create_table :contentelements do |t| | |
t.string :name | |
t.text :data | |
t.references :elementdefinition | |
t.timestamps | |
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
<%= | |
raw Liquid::Template.parse( | |
'<table>{% tablerow item in items cols: 2 %} | |
<td>{{ item.id }}</td> | |
<td>{{ item.created_at }}</td> | |
{% endtablerow %} | |
</table> | |
' | |
).render('items' => Element.find(:all).collect{|item| item.attributes}) | |
%> |
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
# have this | |
attribs = ['src', 'alt', 'title', 'longdesc'] | |
# call this | |
raw Liquid::Template.parse(@element.template.data).render( | |
'src' => data['src'], | |
'alt' => data['alt'], | |
'title' => data['title'], | |
'longdesc' => data['longdesc'], | |
) |
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
Element HasOneToMany Blocks | |
Block HasOne Element OR HasOne Data | |
Element AlwaysBelongsTo Definition | |
Definition HasZeroToMany Elements | |
Element AlwaysBelongsTo Transformation | |
Transformation HasZeroToMany Elements | |
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
http://thechangelog.com/post/1121940971/terminitor-automate-your-workflow |
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
http://railstrip.ourgreatjourney.com/how-to-paginate-sort-and-search-a-table-with-ajax-and-rails-jquery-style/ |
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
# index.js.erb: | |
$("#products").html( | |
"<%= escape_javascript(render('products')) %>" | |
); | |
$("#products_search_hidden_fields").html( | |
"<%= escape_javascript(render('products_search_hidden_fields')) %>" | |
); | |
# index.html.erb: | |
<%= form_tag products_path, :method => 'get', :id => "products_search" do %> |
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
// Place your application-specific JavaScript functions and classes here | |
// This file is automatically included by javascript_include_tag :defaults | |
$(function() { | |
// Hide the form button | |
$('#products_search input[type="submit"]').hide(); | |
// Push searches onto the location hash | |
var inputTimeoutId = -1; |
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
# TODO: do label translation here as well. | |
@@labels = { | |
:price => 'Price incl. VAT' | |
} | |
def self.labels(attribute_name) | |
if @@labels[attribute_name] | |
@@labels[attribute_name] | |
else | |
attribute_name.to_s.titleize | |
end |
OlderNewer