Я запускаю RoR 3.2.0.rc1, Ruby 1.9.2 и я работаю на одной Ubuntu 11.10
Существует имя ошибки => ArgumentError в LookController # на
неправильное числоаргументы (0 для 1)
Rails.root: /home/rene/ruby_dev/ch05/txt2fields
Application Trace | Framework Trace | Full Trace
app/controllers/look_controller.rb:3:in 'text1'
app/controllers/look_controller.rb:10:in 'at'
Запрос
Параметры:
{"utf8"=>"✓",
"authenticity_token"=>"5lxmVZMjEw4ifKaZHgevnr8hnsIyk+wD0WmZC71KMbc=",
"text1"=>"René",
"text2"=>"63",
"method"=>"post"}
look_controller.rb
class LookController < ApplicationController
def text1(string)
end
def trxt2(string)
end
def at
@data = params[text1]
@age = params[text2]
end
def input
end
end
imput.html
<!DOCTYPE html>
<meta charset="UFT-8"/>
<head>
<meta http-equiv="content-type" content="text/html"; charset="UTF-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<!-- ... autres mentions de l'entête de fichier ... -->
</head>
<html>
<head>
<title>Projet 3textfields, fichier input.rhtml</title>
</head>
<body>
<h1>Les champs de saisie (champs de texte) : Exercice # 3</h1>
<br>
Cette application Ruby on Rails lit du texte saisi.
<br>
<br>
Elle transmet la variable au modele.
<br>
<%= form_tag :action => 'at', :method => :post%>
<br>
Votre nom.
<br>
<%= text_field_tag "text1", nil, :size => 30%>
<br>
Votre age.
<br>
<%= text_field_tag "text2", nil, :size => 30%>
<br>
<br>
<input type="submit"/>
<%=form_tag %>
</body>
</html>
at.html
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html"; charset="utf8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<!-- ... autres mentions de l'entête de fichier ... -->
</head>
<html>
<head>
<title>Les champs de saisie : Exercice #2</title>
</head>
<body>
<h1>Les champs de saisie ( Exercice #2 at.html )</h1>
<br>
<br>
Vous vous appelez : <%= @data %>.
<br>
Vous avez : <%= @age %> ans.
<br>
<br>
</body>
</html>
У меня ошибка, когда я вставляю один французский акцент в input.html
Это моя проблема??? * * один тысяча двадцать-шесть