Browse files

Tradotto 06_ActionView fino a 04

  • Loading branch information...
1 parent 600cab3 commit c998f281491b18a70e2ef92295596479e322e630 @grigio grigio committed Jun 17, 2008
@@ -2,36 +2,37 @@
### register\_javascript\_expansion
-This method registers one or more javascript files to be included when a symbol, defined by the programmer, is given as a parameter to the **javascript\_include\_tag** method. The idea is to call this method inside the **init.rb** of your plugin, in order to register the javascript files which your plugin places in the folder **public/javascripts**. Let's see how it works:
+Questo metodo registra uno o più file javascript per essere inclusi quando un simbolo, definito dal programmatore, è dato come parametro al metodo **javascript\_include\_tag**. L'idea è di chiamare questo metodo dentro il file **init.rb** del plugin, per registrare i file javascript che il plugin mette in **public/javascripts**. Ecco come funziona:
- # In the init.rb file
+ # Nel file the init.rb
:monkey => ["head", "body", "tail"]
- # In our view:
+ # Nella view:
javascript_include_tag :monkey
- # We are going to have:
+ # Otteremo qualcosa come:
<script type="text/javascript" src="/javascripts/head.js"></script>
<script type="text/javascript" src="/javascripts/body.js"></script>
<script type="text/javascript" src="/javascripts/tail.js"></script>
### register\_stylesheet\_expansion
-This method does exactly the same as the **ActionView::Helpers::AssetTagHelper#register\_javascript\_expansion** method, but it creates a symbol to be used later when making calls to **stylesheet\_link\_tag** method. Look an example:
- # In the init.rb file
+Questo metodo fa esattamente lo stesso di **ActionView::Helpers::AssetTagHelper#register\_javascript\_expansion**, ma crea un simbolo per essere usato dopo tramite il metodo **stylesheet\_link\_tag**. Si osservi l'esempio:
+ # Nel file the init.rb
:monkey => ["head", "body", "tail"]
- # In our view:
+ # Nella view:
stylesheet_link_tag :monkey
- # We are going to have:
+ # Otteremo qualcosa come:
<link href="/stylesheets/head.css" media="screen" rel="stylesheet"
type="text/css" />
<link href="/stylesheets/body.css" media="screen" rel="stylesheet"
type="text/css" />
<link href="/stylesheets/tail.css" media="screen" rel="stylesheet"
- type="text/css" />
+ type="text/css" />
@@ -2,6 +2,6 @@
### submit\_tag
-It was added the **:confirm** option in the parameters of **#submit\_tag** method. This option works the same way like the method **link\_to**. Look an example:
+È stata aggiunta l'opzione **:confirm** nei parametri del metodo **#submit\_tag**. Questa opzione funziona allo stesso modo del metodo **link\_to**. Si osservi l'esempio:
- submit_tag('Save changes', :confirm => "Are you sure?")
+ submit_tag('Salva le modifiche', :confirm => "Sei sicuro?")
@@ -2,6 +2,7 @@
### number\_to\_currency
+Il metodo **number\_to\_currency**
The **number\_to\_currency** method now accepts the **:format** option as a parameter,letting us to format the method's returning value. In earlier versions, when we had to format values for our local currency, we needed to include a space in front of **:unit** option to make the output format correct. See the examples:
# R$ is the symbol for Brazilian currency
@@ -21,4 +22,4 @@ Besides that, we can customize in other forms, for example:
When creating your own formatting string, you can use the following parameters:
%u For the currency
- %n For the number
+ %n For the number

0 comments on commit c998f28

Please sign in to comment.