To anyone who has work with Ruby on Rails and LAMP(linux,apache,mysql,php) arch.
I got this new web project where I was planning using LAMP for the front-end and back-end and using ruby code for other server process/tasks.
I try looking in forums but haven’t found much since this is uncommon, but in your experience is this good or bad, the pros and cons.
If it has been succesfully implemented or have any example, let me know. Would you rather using just one or both or which one in what case.
Thanks in advance!
I have a view that uses the
select method in Ruby on Rails to return the following code:
<select class="form-control" name="xyz" id="food_id">
link_to method in my view, such as the following:
<%= link_to "Import text", "#/", :onclick => "fillTextBox()" %>
In the JS file, how can I basically get the name and description of whatever value is selected in the dropdown? This is as far as I’ve gotten before I got confused:
var dropdown = document.getElementById('food_id');
var foodID = dropdown[dropdown.selectedIndex].value;
I need to do something like:
var foodName = Food.find(foodID).name;
var foodDescription = Food.find(foodID).description;
Is this possible? The rest of the JS function would basically fill in a textbox using foodName and foodDescription, but I first need to be able to query the database for this information in the first place.