SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Question about render

    When I use

    Code:
    render :layout => false
    it doesn't generate a layout, and thats what I want because I am generating an AJAX response. However, it doesn't pass any variables I have in my code to the file.

    For instance:
    Code Ruby:
    	def authenticate
    		render :layout => 'response'
    		@parameters = 'test'
    	end

    Will not pass @parameters to my view file. Can anyone shed light on how I would do this with Rails? Also one other quick question...

    Would I access a post field with the name user[Username] like
    Code:
    params[:user][:Username]
    ?

    Thank you for the help.
    Have a good day.

  2. #2
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry guys it was a dumb logical mistake!

    I have to place render at the bottom of the method. Ooops. And the code below works too.
    Have a good day.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •