Hi, (first of all, I have English as second language. I'm sorry for any mistake.)
So, I'm getting used to RoR but there are quite things that I can't do.
I'm having a problem whit responds_to_parent. All the action works ok, data goes to the db, but the screen don't change.
Codes:
controller /********************************************************************************************** def create if param_posted?(:attachment) if params[:employee] and params[:address] @attachment = Attachment.new(params[:attachment]) @address = Address.new(params[:address]) @employee = Employee.new(params[:employee]) if @attachment.save if @address.save @employee.address_id = @address.id @employee.attachment_id = @attachment.id if @employee.save #@employee.login!(session) !@#$%^&*&^%$#@!@#$%^&*&^%$# o que é isso... mudar! flash[:notice] = "Empregado cadastrado" responds_to_parent do render :update do |page| page[:history_area].replace show_histories(@employee.id,ApplicationHelper::Employee_type) page[:show_area].replace :partial => "/employee/show_area", :object => @employee if session[:employee_list_style] == "list" page[:employee_list_area].replace :partial => "/employee/employee_list" else page[:employee_list_area].replace :partial => "/employee/employee_list_block" end end end end end end end @employee.clear_password! end end ***********************************************************************************************/
view /*********************************************************************************************** <div id="show_area"> <h1>Employee#register</h1> <%= error_messages_for "attachment_meta", "employee", "address" %>
<% form_for :attachment, :url => {:controller => 'employee', :action => 'create'}, :html => { :multipart => true, :target => 'upload_frame'} do |form_attachment| -%> <%# form_for :attachment, :url => {:action => 'create'}, :html => { :multipart => true } do |form_attachment| -%> <fieldset> <div class=""> <label for="photo">photo </label> <%= form_attachment.file_field :uploaded_data %> </div>
<%#Render _employee_form.rhtm. -%> <%= render (:partial => "employee_form") %>
<%#Render _address.rhtm. -%> <%= render (:partial => "/common/address") %>
<%= submit_tag "Cadastrar", :class => "submit" %> </filedset> <% end -%> <iframe id='upload_frame' name="upload_frame" style="width:1px;height:1px;border:0px" src="about:blank"></iframe> </div> ***********************************************************************************************/
Also I changed the name of the plugin folder, form svn to responds_to_parent.
The code may look strange or not too good... heheeh I'm knew on this... any help I will be thankful.
Best regards.
MrSousa