Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have an action in UserController that I want to use layout for JournalController.
- The issue I'm having is that neither my instance variables (@page_title) nor my flash variables are getting rendered.
- ## UserController app/controllers/user
- def change_password
- render :layout => 'journals'
- @page_title = "Change Password"
- @user=session[:user]
- if request.post?
- @user.update_attributes(:password=>params[:user][:password], :password_confirmation => params[:user][:password_confirmation])
- if @user.save
- flash[:message]="Password Changed Successfully"
- else
- flash[:error]="There was an error saving your password. Please try again."
- end
- end
- end
- ## app/view/layouts/journal.rhtml
- <title><%= @page_title %></title>
- <!-- More Code here -->
- <div class="notice">
- <%= flash[:message] %>
- </div>
- <div class="error">
- <%= flash[:warning] %>
- </div>
- <div class="error">
- <%= flash[:error] %>
- </div>
- <!-- More Code here -->
- <div id="content" class="content_outer">
- <div class="content_inner">
- <%= yield %>
- </div>
- </div>
Add Comment
Please, Sign In to add comment