I am learning rails and encountered the respond_to for a javascript response, and was wondering if there is a way to inline it within the actual respond_to block as opposde to cluttering up my project directory with rjs files that only have one line of code. Is there a way to execute javascript insde the respond_to block rather than returning an rjs file?
On Sep 14, 12:33 pm, indigo0086 <indigo0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am learning rails and encountered the respond_to for a javascript > response, and was wondering if there is a way to inline it within the > actual respond_to block as opposde to cluttering up my project > directory with rjs files that only have one line of code. Is there a > way to execute javascript insde the respond_to block rather than > returning an rjs file?That''s what render :update does. Fred
Awesome, thanks On Sep 14, 8:13 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sep 14, 12:33 pm,indigo0086<indigo0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I am learning rails and encountered the respond_to for a javascript > > response, and was wondering if there is a way to inline it within the > > actual respond_to block as opposde to cluttering up my project > > directory with rjs files that only have one line of code. Is there a > > way to execute javascript insde the respond_to block rather than > > returning an rjs file? > > That''s what render :update does. > > Fred