ruby-on-rails
Postgres Rank As Column
I have the following query: SELECT name, rank() OVER (PARTITION BY user_id ORDER BY love_count DESC) AS position FROM items[详细]
2023-04-13 07:53 分类:问答With Rails 3, Ruby 1.9.2, how do I make a table sortable on a column that is NOT a DB column?
It is ea开发者_开发问答sy, following this railscast http://railscasts.com/episodes/240-search-sort-paginate-with-ajax to be able to create a table that sorts based on columns that exist in my database[详细]
2023-04-13 07:47 分类:问答How to write directly to database with rails
Basically i would like to bypass def something=(string) ... end and do create!(:something => \"direct to database\")[详细]
2023-04-13 07:45 分类:问答Rails : Why my first page does not show? (routing error)
I use scaffold to create my first MVC in Rails 3.1 rails generate scaffold Post name:string title:string content:text[详细]
2023-04-13 07:45 分类:问答has_many associations table confusing
My goal here is to print list of users from specified city and category with their names, address and club name.Name and address display correctly but when i add club name,says undefined method member[详细]
2023-04-13 07:42 分类:问答Rails how to allways gsub column before save?
I am trying to make gsub on my column before save or update. Here is my controller: def dansk(text) self.text.gsub(\'å\', \'å\')[详细]
2023-04-13 07:37 分类:问答Dynamically altering value of a textbox
Using Rails, I am building a new wiki system from scratch; however, I am unsure how to handle the buttons for the \"create a page\" se开发者_Python百科ction. Where, for example, a person were to press[详细]
2023-04-13 07:37 分类:问答flash notice persisting in rails controller
I\'ve got a controller with an update method that updates the model attribute, sets a flash notice for the user if successful and then renders the edit page again. The next link I click on the same fl[详细]
2023-04-13 07:33 分类:问答Rails NoMethodError in controller
this is in my controller def results #searches with tags @pictures = Picture.all @alltags = Tag.all searchkey = params[\'my_input\'][详细]
2023-04-13 07:32 分类:问答Why does ActiveRecord provide .delete_all and not .truncate?
It seems strange that I have to manually execute SQL to use the TRUNCATE command. Is there something bad about it that DHH is p开发者_StackOverflowrotecting me against?Using TRUNCATE on some databases[详细]
2023-04-13 07:30 分类:问答