# --------------------------------- users_controller.rb--------------------------------- def index @users = User.search(params[:search], params[:page]).order(:username) end def new @habilitar_opciones = false @user = User.new end def edit @habilitar_opciones = true end # --------------------------------- users_controller.rb--------------------------------- # --------------------------------- userscuentas_controller.rb--------------------------------- def index @userscuentas = @user.userscuentas.all end def new @userscuenta = Userscuenta.new end def edit end # --------------------------------- userscuentas_controller.rb--------------------------------- # --------------------------------- app/views/users/layout_users.html.erb----------------------
  • Cuentas
  • <%= render :file => "/userscuentas/index.html.erb" %>

    <%= render :partial => 'layout_users' %> # --------------------------------- app/views/users/new.html.erb---------------------- # --------------------------------- app/views/users/edit.html.erb---------------------- <%- model_class = User -%> <%= render :partial => 'layout_users' %> # --------------------------------- app/views/users/edit.html.erb---------------------- # --------------------------------- app/views/users/form.html.erb---------------------- <%= javascript_include_tag "fecha" %> <%= simple_form_for @user, :html => {:multipart => true} do |f| %> <% if @user.errors.any? %>

    Error al Guardar los Cambios

    <% end %>
    Informacion Personal
    the rest of the fields <% end %> # --------------------------------- app/views/users/form.html.erb---------------------- # --------------------------------- app/views/userscuentas/index.html.erb---------------------- <% @userscuentas.each do |userscuenta| %> <%= link_to userscuenta.id, userscuenta_path(userscuenta) %> <%= userscuenta.nombre %> <%= userscuenta.nro_cuenta %> <%= userscuenta.tipo_cuenta %> <%= userscuenta.user_id %> <%=l userscuenta.created_at %> <%= link_to t('.edit', :default => t("helpers.links.edit")), edit_userscuenta_path(userscuenta), :class => 'btn btn-mini' %> <%= link_to t('.destroy', :default => t("helpers.links.destroy")), userscuenta_path(userscuenta), :method => :delete, :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-mini btn-danger' %> <% end %>