First of all, if you want to use puts in your views, use <% %> tags rather than <%= %> tags.
Secondly, if you load your partials once you have your data object(@project) with appropriate value your page should display the same.
But if you change the value of @project.version after the partial is loaded, it would not be reflected on the page until you reload the particular div which has the text field tag with the partial.
First of all, if you want to use puts in your views, use <% %> tags rather than <%= %> tags.
I defines a partial see below:
<%=
puts @project.version
text_field_tag "project_version", @project.version
%>
The above will puts the @project.version to the STDOUT stream, then will return the text_field_tag into the <%= %> location.
This is a subtle hair to split (and 'p' is more useful than 'puts' there), but debugging out of the top of a <%= %>, while expressing its last line, is very common...
First of all, if you want to use puts in your views, use <% %> tags
rather
than <%= %> tags.
Secondly, if you load your partials once you have your data
object(@project)
with appropriate value your page should display the same.
But if you change the value of @project.version after the partial is
loaded,
it would not be reflected on the page until you reload the particular
div
which has the text field tag with the partial.
-NAYAK
On Tue, Dec 30, 2008 at 6:42 PM, Zhao Yi
Hi,
This is my controller code:
def update_project_selection
@project = Project.find(:all,:conditions=>"name='#{selected_project}'
")
render :partial => "project_version", :layout=>false
end
I update the @project object before load the partial. Why does the page
display the same value?