def find
lemma = Lemma.find_by_lemma(params[:lemma])
if lemma
redirect_to (:controller => “lemma”, :action => “show”)
else
flash.now[:notice] = “Unable to find lemma: #{lemma}.”
end
end
It appears that the view does not pass back any value to the controller,
or passes an empty value, because the flash notice does not print any
value of the lemma, thus:
or passes an empty value, because the flash notice does not print any
value of the lemma, thus:
Unable to find lemma: .
You want:
flash.now[:notice] = “Unable to find lemma: #{params[:lemma]}.”
–
We develop, watch us RoR, in numbers too big to ignore.
Hi,
Thank you, yes, that makes sense. However it all the more confirmed that
the controller action is not getting any value back from the Find view
since the notice does not print any return value.
Thanks for taking the time to reply.
gk
I also added p params[:lemma] to the Find action, but the server.log is
empty. Is that where it will send the output to?
The helper text_field is expanded as:
The values of name and type are correct.
So it does look like the view is returning nothing or something that the
controller interprets as null. (pulling my hair)
Thanks,
gk
Processing EngLemmaController#find (for 127.0.0.1 at 2006-08-07
01:51:17) [GET]
Session ID: ea3ac9c50cc7a0d7bf5830462e8292ab
Parameters: {“class”=>“submit”, “action”=>“find”,
“controller”=>“eng_lemma”}
e[4;36;1mSQL (0.015000)e[0m e[0;1m SELECT a.attname,
format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = ‘eng_lemmas’::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
e[0m
e[4;35;1mEngLemma Load (0.141000)e[0m e[0mSELECT * FROM eng_lemmas
WHERE (eng_lemmas.“lemma” IS NULL ) LIMIT 1e[0m
Rendering within layouts/application
Rendering eng_lemma/find
Completed in 0.17200 (5 reqs/sec) | Rendering: 0.01600 (9%) | DB:
0.15600 (90%) | 200 OK [http://localhost/eng_lemma/find?class=submit]