[Rails] .rjs template doesn't load?
Joshua Gitlin
josh at digitalfruition.com
Mon Feb 6 20:52:14 GMT 2006
Nick,
I might try that. But the issue is even worse. It doesn't matter if
it's an RJS template. Even if it's an RHTMl templaye, the code in the
template just isn't executed:
controller:
if params[:commit] && @item.save
if (request.xhr?)
logger.debug "About to render"
render(:partial => 'completechanges')
_completechanges.rhtml:
test
<% logger.debug "This came from the partial" %>
development.log:
...
SQL (0.000150) COMMIT
About to render
where is my "This came from the partial"?
-Josh
-----------
Due to the recent increase in spam and falsely sent email, I now PGP
Sign all of my outgoing mail to prove my identity. This means that
you will see an attachment called "PGP.sig" with this message. This
attachment can be used to prove that I am who I say I am. If you are
not familiar with PGP, you can safely ignore it. For more
information, please visit http://www.pgp.com/ or http://www.gnupg.org/
On Feb 6, 2006, at 3:40 PM, Nick Stuart wrote:
> I'm not sure how well RJS templates work with partials. I use Toms
> route myself and will have a complete rjs template for methods like
> create or update which would previously not have any.
>
> Try making a create.rjs and have a flag in there like Tom suggested
> and see what happens. Skip the partial for now (at least on the xhr
> requests) to see if it helps.
>
> -Nick
>
> On 2/6/06, Joshua Gitlin <josh at digitalfruition.com> wrote:
>> Tom,
>>
>> That would work well, problem is, I can't make my action render
>> *anything* besides :text...
>>
>> -Josh
>>
>> -----------
>> Due to the recent increase in spam and falsely sent email, I now PGP
>> Sign all of my outgoing mail to prove my identity. This means that
>> you will see an attachment called "PGP.sig" with this message. This
>> attachment can be used to prove that I am who I say I am. If you are
>> not familiar with PGP, you can safely ignore it. For more
>> information, please visit http://www.pgp.com/ or http://
>> www.gnupg.org/
>>
>> On Feb 6, 2006, at 2:50 PM, Tom Wilcoxen wrote:
>>
>>> Josh,
>>>
>>> I have a similar requirement, but addressed it a little
>>> differently. I
>>> don't know which is better. I set an instance variable in my
>>> controller called @error and fill it with a message if the action
>>> fails. Then in my .rjs I do:
>>>
>>> if @error
>>> page.show 'ajax-error'
>>> page.replace_html 'ajax-error', @error
>>> else
>>> page.hide 'ajax-error'
>>> page.replace_html 'my-div-name', :partial => 'mypartial'
>>> page.visual_effect :highlight, 'my-div-name', :duration => 1.5
>>> end
>>>
>>> -Tom
>>> _______________________________________________
>>> Rails mailing list
>>> Rails at lists.rubyonrails.org
>>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>>
>>
>> _______________________________________________
>> Rails mailing list
>> Rails at lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>>
>>
>>
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060206/0f273f1d/PGP.bin
More information about the Rails
mailing list