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
def show | |
@post = current_user.posts.find_by_id params[:id] | |
unless @post | |
redirect_to posts_path, :alert => 'Post not found' | |
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
If for some reason you cannot inherit from InheritedResources::Base, you can call inherit_resources in your controller class scope: | |
class AccountsController < AnotherController | |
inherit_resources | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>*****</title> | |
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css"> | |
<script src="/assets/application.js" type="text/javascript"></script> | |
</head> | |
<body> |
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
config.actions do | |
# root actions | |
dashboard # mandatory | |
# collection actions | |
index # mandatory | |
new | |
export | |
bulk_delete | |
# member actions | |
show |
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
pt-BR: | |
home: | |
name: Home | |
views: | |
pagination: | |
previous: "« Anterior" | |
next: "Próximo »" | |
truncate: "…" | |
admin: | |
misc: |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.0' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
gem 'twitter-bootstrap-rails', '2.0' | |
gem 'spec' |
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 | |
$form = new Zend_Form(); | |
// Add your elements here | |
$form->removeDecorator('HtmlTag'); | |
$elementNames = array(); | |
foreach ($form->getElements() as $element) { |
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
#!/usr/bin/php | |
<?php | |
if (!isset($argv[1])) { | |
exit('Please, choose a number.'. PHP_EOL); | |
} | |
$numero = (int) $argv[1]; | |
if ($numero < 3 || $numero > 1000) { | |
exit('Number should be between 3 and 1000.'. PHP_EOL); |
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
if ( unique_clickers_form.getValue('unique') == false ) { | |
data = unique_clickers_form.getValue('filtered'); | |
} else { | |
data = unique_clickers_form.getValue('unfiltered'); | |
} | |
clickers_grid.dataSource.testData = data; | |
clickers_grid.invalidateCache(); |
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
criteria = clickers_grid.getCriteria(); | |
clickers_grid.setData(data); | |
clickers_grid.dataArrived(); | |
clickers_grid.setCriteria(criteria); |
NewerOlder