views:

1955

answers:

2

Hi,

I use the rails 3.0.0.beta

Is there any new syntax to write RJS, here is an example

  def remote_create
    @photo = Photo.new(params[:photo])

    respond_to do |format|
      if @photo.save
        # add @photo's thumbnail to last import tag
        format.js {
          render :update do |page|
            page.insert_html :bottom, 'polaroids' , :partial    => 'polaroid', :locals => {:photo => @photo}
          end 
        }
      else
        #...
      end
    end
  end
A: 

not sure on any syntax changes for rails 3 irt rjs but i recommend following along over at railscasts.com - he's been posting videos of all the new features of rails 3 and if there are any updates on how to render/handle js i'm sure he'll do an episode on it.

BandsOnABudget
I never miss an episode ;o)
denisjacquemin
+1  A: 

here is the screencast http://railscasts.com/episodes/205-unobtrusive-javascript

denisjacquemin