Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8755521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:52:29+00:00 2026-06-13T13:52:29+00:00

I need make system call from method of Ruby of Rails , but I

  • 0

I need make system call from method of Ruby of Rails , but I want it to stay on the same page.
Right now for some reason it does not execute , but shows :

Routing Error

No route matches [POST] "/devices/22918"
Try running rake routes for more information on available routes.

This is the button:

<%= link_to image_tag("/images/glossy_green_button.png"), device , :method => :turnon, :confirm => "Are you sure?" %>

This is method:

def turnon
@device = Device.find(params[:id])
result = `/perl/toggle.pl @device.infodot on`
end

please let me know what I am doing wrong,

thank you

D

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:52:29+00:00Added an answer on June 13, 2026 at 1:52 pm

    You’re simply not using the method correctly. You’re using it to target the action of the controller you want to execute (note that I explicitly said action and not method for clarity).
    Available actions in a controller are defined by your routes.rb file.You should eventually read or re read that

    In your case, let’s say you have a resource device (I guess this is what you have), you’ll first create a new action in your routes.rb file

    resources :devices do
      put :turnon, on: :member
    end
    

    You can read doc about this syntax here but basically I’m making the action turnon available via the HTTP PUT method on each devices, meaning that it will be accessible through the URL /devices/1/turnon or via the url_helper : turnon_device_path (or turnon_device_url)

    I assume that your turnon action will modify existing things, not creating new things, that’s why I’m using the PUT verb

    Then the link will look something like :

    <%= link_to image_tag("/images/glossy_green_button.png"), turnon_device_path(device) , :method => :put, :confirm => "Are you sure?" %>
    

    see that the method is the HTTP method corresponding to the new route I created.

    I also assume that you put the turnon method in the DevicesController.

    Finally as you want to do that in ajax, you can have a look a the remote: true option

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that I need to call from another page more that
In my Django web page I need Javascript to call a public method of
I'm facing the following issue: I need to make a call from my controller
I need to make a HTTPS call from client. I do not need to
I need to make a moderate system like the one in fmylife.com. Basically the
I need to make a java program with a security and a login system
Our system complexity has risen to the point that we need to make permission
How can i make mysql start every time the system boot ? I need
Need to make certain Ruby strings in my program to be immutable. What is
I need to call a python script from C#, I'll be doing it like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.