[typo] Admin controller hacking

Micah Wylde wyldeone at gmail.com
Sat Dec 3 23:28:34 EST 2005

The arguement that the script.aculo.us scripts use refers to the id of the
div to which the effect is to be applied. So, to make your example work you
would have to have the partial be:

<div id="messages"><p>Changes published</p></div>
 My js isn't very good, and I'm not sure that it can be placed just in the
body like that. You may need to also place the javascript somewhere else.

 On 12/3/05, Tracey <tenthconcept at gmail.com> wrote:
> I have been spending some time learning Rails and I thought one of the
> easiest
> ways is to contribute to typo.  My first thoughts were to clean up the
> admin
> interface.
> When you "Publish Changes" in the admin sidebar controller it uses render
> :partial=>'publish' to flash the message "Changes published."
> I think it would be a good idea to use this in other controllers.  For
> example,
> in the theme controller, you recieve no feedback when you activate a new
> theme.
> Just to do something quick, in themes_controller.rb, I added render
> :partial=>'publish' to switchto():
> def switchto
>     setting = (Setting.find_by_name('theme') or Setting.new("name" =>
> 'theme'))
>     setting.value = params[:theme]
>     setting.save
>     render :partial => 'publish'
>     redirect_to :action => 'index'
>   end
> and I then inserted _publish.rhtml in /app/views/admin/themes with this
> code:
> <p>Changes published</p>
> <script type="text/javascript">new Effect.Highlight("messages");</script>
> Nothing happens with these changes.  What could the problem be?  Is there
> another way of accomplishing this?  I am new to Rails and programming, so
> any
> help, thoughts or ideas are greatly appreciated.
> Tracey
> http://52reasons.ath.cx
> _______________________________________________
> Typo-list mailing list
> Typo-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/typo-list

Micah Wylde
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/typo-list/attachments/20051203/627cca0b/attachment.htm

More information about the Typo-list mailing list