Felix Pujols

Joined

160 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in Convert a rails web application to offline or executable

I have tried to use ruby packer and traveling Ruby and others but as I am new to programming it is difficult for me. I'm looking for a programmer to convert a web application to offline or executable. Using something like ruby-packer. I can pay for it, Thank you

I'm new on rails, I would appreciate any help. This is the repository of this project: https://github.com/felixpro/Kadra

when a client signup an email is sent to the mail of the admin to approve that client otherwise the client will never be able to log in

I am having problems sending emails, in development and production environment. I have tried everything, but nothing is working for me.

maillers/user_mailer.rb

class UserMailer < ApplicationMailer
  default from: 'from@example.com'
      layout 'mailer'

      def new_user_waiting_for_approval(user)
        @user = user
        mail(to: 'pujols.fr@gmail.com', subject: 'New User Awaiting Admin Approval')
      end

end

controllers/user_controller.rb

 def create
    @user = User.new(user_params)

    respond_to do |format|
      if @user.save
        UserMailer.new_user_waiting_for_approval(@user).deliver_now
        format.html { redirect_to @user, notice: 'User was successfully created.' }
        format.json { render :show, status: :created, location: @user }
      else
        format.html { render :new }
        format.json { render json: @user.errors, status: :unprocessable_entity }
      end
    end
  end

Thank you, but still not working.

I did that:

<td><%= best_in_place customer_service_path(), :process %></td>

an it's giving me an error:

No route matches {:action=>"show", :controller=>"services", :id=>"2"}, missing required keys: [:customer_id]

I have an application that has customers and services. Customers has_many services and service belongs_to customer. In the customer show page, I can add or delete services. But I can not edit services, so I'm using best_in_place to do that. but is not working. It returns undefined method `service_path'. I will appreciate any help, I'm new in software.

here is the repository link if you want to check the whole app.

https://github.com/felixpro/ars-reclama/commits/master

I restarted the server, but it keeps returning the same error.

customer/show.html.erb


   <% @customer.service.each do |service| %>
      <%= best_in_place service, :process  %>
   <% end %>

customer_controller.rb


def show
    @customer = Customer.find params[:id]
    @service = @customer.service.order('created_at DESC').limit(4)
  end


  def edit
    @customer = Customer.find params[:id]
  end

service_controller.rb

  def edit
    @customer = Customer.find params[:id]

    @service = @customer.services.find(params[:id])
  end


  def update
    @service = Service.find(params[:id])

    respond_to do |format|
      if @service.update(service_params)
        format.html { redirect_to @service, notice: 'Service was successfully updated.' }
        format.json { render :show, status: :ok, location: @service }
      else
        format.html { render :edit }
        format.json { render json: @service.errors, status: :unprocessable_entity }
      end
    end
  end

routes.rb

resources :customers do
    resources :services
  end