you have to post some of your layout code , but it seems like there is a
problem with your login form and is getting submitted when you try to
access the page, but to be sure we have to see some of the lay out code
and
we have to know it the login form can be triggered by JS
ActionView::TemplateError (undefined local variable or method `message’
for
#ActionView::Base:0xb6080e74) on line #32 of
app/views/layouts/application.html.erb:
29:
30:
31:
32: <% message.each do |name, msg| %>
33: <%= content_tag :div, msg, :id => “flash_#{name}” %>
34: <% end %>
1)the problem occurs after hitting the submit button, meaning after the
validation failes
2)old rails app > restful_authentication
3)login form is more or less basic functionailty, but quite a few
fields.
ill stripp it down later.
if @user.errors.empty?
flash[:notice] = "Thanks for signing up! Please check your email
to
activate your account."
else
p @user.errors
flash[:error] [email protected]
flash[:notice] = “Error SignUp - pls try again - Support has been
contacted!”
redirect_to signup_url
end
end
result is still:
ActiveRecord::RecordInvalid in UsersController#create
Validation failed: Password is too short (minimum is 4 characters)
On Mon, Oct 25, 2010 at 11:42 AM, radhames brito [email protected]
wrote:
On Mon, Oct 25, 2010 at 11:41 AM, radhames brito [email protected]wrote:
remove the ! from the save , when you add a shebang to a rails method you
force an exception, so instead of just outputting the age with is flash
message you are making rails raise and exception
remove the ! from the save , when you add a shebang to a rails method
you
force and exception, so instead of just outputting the age with is flash
message you are making rails raise and exception
I think this will cause an error since you are passing a collection to a
hash that takes a string, let the form helper handle this and dont use
many
flashes with the loop or you will only see the last flash set
now i have this:
1) @user.save
if @user.errors.empty?
flash[:notice] = “Thanks for signing up! Please check your email
to
activate your account.”
else
redirect_to signup_url
end
2)
validation via model are al set
<% flash.each do |key, msg| %>
<%= content_tag :div, msg, :class => "flash", :id => key %>
<% content_tag :script, :type => "text/javascript" do %>
$('<%= key %>').style.display = 'none';
new Effect.Appear('<%= key %>', {duration: 3});
<% end %>
<% content_tag :script, :type => “text/javascript” do %>
setTimeout(“new Effect.Fade(’<%= key %>’);”, 10000);
<% end %>
<% end %>
<%= yield :layout %>
but the only thing i see is this:
'Input
literally, the string “'Input” is being displayed between the hr tags…
im confused
sense, but still the output is not what you expect since you will be getting
flash_error, flash_notice and such and not just error and notice which is
the key
On Mon, Oct 25, 2010 at 12:19 PM, radhames brito [email protected]
wrote:
new Effect.Appear('<%= key %>', {duration:
<% end %>
<%= yield :layout %>
for some reason i forgot this is ERB so this $(‘<%= key %>’) does
makes
sense, but still the output is not what you expect since you will be
getting
flash_error, flash_notice and such and not just error and notice which
is
the key