可以通过Rails路由重写路由,如下所示

时间:2016-10-21 18:54:49

标签: ruby-on-rails routing

我们希望运行'rails / mailers'路线预览电子邮件,例如

(++)(-+)

我想要这个网址

http://domain.dev/rails/mailers

以及从rails / mailers更改的后续URL请求 - > admin / admin_email_preview like:

http://domain.dev/admin/admin_email_preview

http://domain.dev/rails/mailers/account/event_beginning_soon

我如何在routes.rb中执行此操作?

1 个答案:

答案 0 :(得分:0)

public void charCopy() throws IOException {

    FileReader fileReader = new FileReader(source);
    FileWriter fileWriter = new FileWriter(target);
    int readChar;

    System.out.println("log : " + this.loggin() + ": copy successfully started !");
    while ((readChar = fileReader.read()) != -1) {

        fileWriter.write(readChar);
    }
    System.out.println("log : " + this.loggin() + ": copy successfully terminated !");
    fileReader.close();
    fileWriter.close();

    System.out.println("log : " + this.loggin() + ": streams successfully closed !");
    System.out.println("log : " + this.loggin() + ": target file ready !");

}

您还需要将邮件控制器移动到admin /子文件夹中。