lets say i have a long sql query with a few selects and merges. I don’t want to start writing the ActiveRecord code for it because its in use only by me. and only once every few weeks (its like a report) I just want to run the query, get the results and display them, as is.
I am new to rails, used to ASP.Net and MVC 3
is there anything I can use for the view that will just render a table off of the query result?
thanks
You can execute raw SQL from within ActiveRecord without needing to bind a class to a table:
You can then either result.to_yaml, result.inspect or pass result to FasterCSV to generate a CSV file for further analysis in Excel or your spreadsheet of choice.
HTH