2 Replies Latest reply on Mar 7, 2015 10:49 PM by OON KEAT NG

    Can I add additional ruby files to the model?

    OON KEAT NG

      Hi all,

       

      Good day.

      Can I add an additional ruby file to the model of my RhoMobile App?

      For instance I have a model called Product and it has edit.erb, index.erb, new.erb, show.erb by default.

      If I have additional view, like show location, can I create show_location.erb and put it to Product folder?

       

      I have this search_box function at product_controller.rb, which contains the following code fragment:

        def search_box

          @product = Product.find(:all, :conditions =>{'box_id' => @params['box_id']})

          #@product = Product.find(@params['box_id']);

          @err_msg = ""

          if @product

            redirect :action => :show_location

          else

            @err_msg = "Box ID not found!"

            render :action => :index

          end

        end

       

      When i try to execute this code, i always get server internal error and show_location.erb was not able to rendered.

       

      Please help.

       

      Many thanks.

       

      Regards,

      Kelly