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
<?xml version="1.0" encoding="utf-8"?> | |
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> | |
<mx:StringValidator source="{nome}" property="text" | |
required="true" | |
minLength="4" | |
requiredFieldError="Campo obrigatório" | |
tooShortError="Valor preenchido é muito curto" | |
trigger="{nome}" triggerEvent="change" | |
valid="status.text='Nome é válido'"/> |
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
<!--=========================================== | |
VALIDADORES | |
=========================================== --> | |
<mx:StringValidator | |
id="tituloValidator" | |
source="{tiTitulo}" | |
property="text" | |
required="true" | |
requiredFieldError="Campo obrigatório"/> |
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
//Função chamada no evento de CLICK do botão Cadastrar | |
private function cadastrarClickHandler():void{ | |
var evTituloValid:ValidationResultEvent = tituloValidator.validate(); | |
var evTextoValid :ValidationResultEvent = textoValidator.validate(); | |
//valida os campos obrigatórios | |
if ((evTituloValid.type== ValidationResultEvent.VALID) && | |
(evTextoValid.type == ValidationResultEvent.VALID)) | |
Alert.show('Validações com sucesso, agora envie para o SERVER', 'Sucesso'); |
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
accounts GET /accounts {:controller=>"accounts", :action=>"index"} | |
formatted_accounts GET /accounts.:format {:controller=>"accounts", :action=>"index"} | |
POST /accounts {:controller=>"accounts", :action=>"create"} | |
POST /accounts.:format {:controller=>"accounts", :action=>"create"} | |
new_account GET /accounts/new {:controller=>"accounts", :action=>"new"} | |
formatted_new_account GET /accounts/new.:format {:controller=>"accounts", :action=>"new"} | |
edit_account GET /accounts/:id/edit {:controller=>"accounts", :action=>"edit"} | |
formatted_edit_account GET /accounts/:id/edit.:format {:controller=>"accounts", :action=>"edit"} | |
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
ActionController::Routing::Routes.draw do |map| | |
map.resources :accounts do |accounts| | |
accounts.resources :people | |
end | |
map.resources :notes, :path_prefix=>"people/:person_id", :name_prefix => "people_" | |
map.resources :comments, :path_prefix=>"notes/:note_id", :name_prefix => "note_" | |
#map.connect ':controller/:action/:id' | |
#map.connect ':controller/:action/:id.:format' |
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
ActionController::Routing::Routes.draw do |map| | |
map.resources :accounts do |accounts| | |
accounts.resources :people | |
end | |
map.resources :notes, :path_prefix=>"people/:person_id", :name_prefix => "people_" | |
map.resources :comments, :path_prefix=>"notes/:note_id", :name_prefix => "note_" | |
#map.connect ':controller/:action/:id' | |
#map.connect ':controller/:action/:id.:format' |
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
map.resources :accounts do |accounts| | |
accounts.resources :people, :name_prefix => "account_" | |
end | |
map.resources :people do |people| | |
people.resources :notes, :name_prefix => "person_" | |
end | |
map.resources :notes do |notes| | |
notes.resources :comments, :name_prefix => "note_" |
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
accounts GET /accounts {:controller=>"accounts", :action=>"index"} | |
POST /accounts {:controller=>"accounts", :action=>"create"} | |
new_account GET /accounts/new {:controller=>"accounts", :action=>"new"} | |
edit_account GET /accounts/:id/edit {:controller=>"accounts", :action=>"edit"} | |
account GET /accounts/:id {:controller=>"accounts", :action=>"show"} | |
PUT /accounts/:id {:controller=>"accounts", :action=>"update"} | |
DELETE /accounts/:id {:controller=>"accounts", :action=>"destroy"} | |
account_people GET /accounts/:account_id/people {:controller=>"people", :action=>"index"} | |
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
# use => ruby rename.rb .jpg thumb_ | |
def generate | |
files = Dir.entries(".") | |
count = 1 | |
files.each do |f| | |
extension = f[/\.[a-z]+$/] | |
if extension == ARGV[0] | |
new_name = "#{ARGV[1]}#{count.to_s}#{extension}" |
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
# use => ruby rename.rb .jpg thumb_ | |
def generate | |
files = Dir.entries(".") | |
count = 1 | |
files.each do |f| | |
extension = f[/\.[a-z]+$/] | |
if extension == ARGV[0] | |
new_name = "#{ARGV[1]}#{count.to_s}#{extension}" |
OlderNewer