I have a object called "category", in my view/store/manage.html.erb, I want to do this :
<%=link_to_remote category.name, :url => delete_category_path(category),
:confirm => 'Are you sure?', :method => :delete%>
But it show me the NoMethodError, how can I do that?
This is the error from RoR:
undefined method `delete_categ...
Hi,
I am looking to understand conceptually what all goes in profiling a ruby or ruby on rails program (e.g. memory usage, speed of request dispatching, speed of connecting with external programs like DB) and what are the best tools (at a conceptual and fundamental level) that are available
Thanks
...
Hello everybody,
I am currently working on a WCF application that consumes a Rails REST Service. The problem is when I do a update or remove request, Rails does not return XML, only the following header:
HTTP/1.1 200 OK
Date: Wed, 13 Jan 2010 13:56:25 GMT
Server: Apache/2.2.14 (Debian)
X-Powered-By: Phusion Passenger (mod_rails/mod_rac...
Hi,
Is it possible to set up a double relationship in a Rails scaffold?
For example, if I had a user model and a private message model, the pm table would need to keep track of both the sender and recipient.
Obviously, for a single relationship I would just do this:
ruby script/generate scaffold pm title:string content:string user:ref...
I have a div id called common, the content that I would like to appear in this div is in the file share/_common.html.erb
What should I put in place of <!-- content from _common.html.erb --> so that the contents of share/_common.html.erb appears in the div?
<div id="common">
<!-- content from _common.html.erb -->
</div>
...
Hi,
Yesterday I was trying to install Sphinx for full-text search on Windows 7. So, I followed their website's installation steps.
Once I installed its windows service, I ran the indexer and then the test search against my app database and it worked great.
Then, I wanted to make it work on Ruby on Rails 2.3.2, so I downloaded and insta...
Hi everybody,
I'm looking for a tutorial or a piece of code that can leads me to create a page
where we can find only 10 data rows per page and navigating with Ajax previous/next arrows
and also page number (i.e.: < 1 2 3 ... 10 > ).
Thank you very much.
...
Hi,
I've just included thinking-sphinx on Ruby-on-rails and I wanted to know how and where I must config the chartset_table so if I search some word with an accent, it returns results as if the word didn't have the accent.
EDIT:
This is my Sphinx.yml config file. Please let me know if there's something wrong with it:
development:
...
So I have two separate queries:
tagged_items = Item.tagged_with(params[:s], :on => :tags)
searched_items = Item.find(:all, :conditions => ["MATCH(title) AGAINST (? IN BOOLEAN MODE)", "*#{params[:s]}*"])
The first tagged_items is using the acts_as_taggable_on plugin to find all the items tagged with XYZ.
The second, searched_items, is...
I am using some code that uses this syntax (restful authentication).
def logged_in?
!!current_user()
end
Tried googling for this but it just seems to ignore "!!", will accept an answer that can tell me how to find info about searching for strings such as !! in google.
...
To make application.js more dynamic, I create javascript_controller and rename public/application.js to app/views/javascripts/application.js.erb
But <%= … %> does not look very good in javascript, are there any better templating engines for this task?
...
I'm building a Rails project that has a cron-type job that I'm managing with Rufus Scheduler. I have two questions about how to set this up appropriately in Rails:
Where's the best place to put the job's code?
Where should I place the Rufus code to schedule the job? How should I kick it off?
...
What is the difference between using form_for the following way:
<% form_for @user do |f| %>
<%= f.label :name %>:
<%= f.text_field :name, :size => 40 %>
...
<% end %>
and:
<% form_for :user, :url => {:action => 'create'} do |f| %>
<%= f.label :name %>:
<%= f.text_field :name, :size => 40 %>
...
<% end %>
Does usi...
Hi,
Is there a simple way to display the entire nested set when using this plugin?
What I would like to do is display an unordered list of root nodes with another unordered list inside each child that also contains children and so on?
Any advice appreciated.
Thanks.
...
I've searched and I've found a lot that are antiquated.
Any suggestions?
...
I am attempting to create a custom route in rails and am not sure if I am going about it in the right way. Firstly I have a RESTful resource for stashes that redirects to mystash as the controller:
map.resources :stashes, :as => 'mystash'
site.com/mystash goes to :controller => 'stashes', :action => 'show'
Which is what I want. Now ...
Hi there,
I'm using Prawnto to generate PDFs in my Rails app. I want three specific options set for my PDFs:
I don't want it to start with a blank page
I want it to download directly (not inline)
I want to specify the filename
Here's my controller method:
def print
@purchase = Purchase.find(params[:id])
prawnto :prawn=>{:sk...
So, I've been looking into logging in my Rails app and I'm discovering, thanks to posts like this, that the default Rails logging format is terrible and there isn't an easy way to change it. Can anyone recommend a simple replacement for the default logger?
Bonus question: Is there a stated reason for why it's so hard to change the defau...
Is it even worth it?
I'm working on assessing a legacy code base for a client -- the source code has been largely untouched since 2007 and it's built with Rails 1.2.3.
My Rails experience began at version 2.1 -- the code is fairly stock/scaffold like and devoid of meaningful tests -- I was curious to even see if I could get it runnin...
I've been a bad kid and used the following syntax in my partial templates to set default values for local variables if a value wasn't explicitly defined in the :locals hash when rendering the partial --
<% foo = default_value unless (defined? foo) %>
This seemed to work fine until recently, when (for no reason I could discern) non-pa...