Displaying 20 results from an estimated 2000 matches similar to: "Rails 3 - Creating a comment and then returning the Partial with JUST the new comment"
2010 Sep 21
25
Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
Hello, I''m working to install the acts_as_commentable plugin on my
Rails 3 app.
After adding "acts_as_commentable" to my book model, I then added a
comment form on my book show view:
<% form_for(@comment) do|f| %>
<%= f.hidden_field :book_id %>
<%= f.label :comment %><br />
<%= f.text_area :comment %>
<%= f.submit "Post
2010 Oct 02
3
MySQL setup question
Hello,
I''m new to ror and i really like it so far! for a new application i
would like to setup a ror application connecting to mysql but i can''t
figure it out how. rails works fine with sqllite out the box but i
need it working with mysql. these are my versions:
-OSX snow leopard
-ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
-Rails 3.0.0
$
2010 Oct 01
20
Paperclip not executing FFMPEG properly
Im using a customs processor to run ffmpeg on a video to create a
thumbnail.
So far so good. Except when I do:
cmd = "-i #{@file.path} -f flv -s 320x240 ~/Downloads/foobar/q.flv"
success = Paperclip.run(''ffmpeg'', cmd)
Console is reporting:
ffmpeg ''-i /var/folders/uL/uL0bYOOZEZaJH5E+BmDJVE+++TI/-Tmp-/stream,
16824,1.mpeg -f flv -s 320x240
2010 Sep 08
5
Adding a selected checkbox to a new nested model without polluting the model
Context:
I have a GoodsReturn model with many ReturnedItem. For the new view, I
create a new GoodsReturn with many new ReturnedItems from a sale (and
its SoldItems).
Problem:
I want to have a Add/Selected checkbox with which the user can pick
the items he wants to return. I know I could use a ''selected'' virtual
attribute but I don''t want to pollute my model just for
2010 Sep 12
11
Rails Commenting, Plugins?
Hello,
I''m looking to add comments to records in my app like Books. So a user
can view a Book and then comment on it...
As a newbie, is this something that I should build from scratch, or
are there any popular Commenting Plug-ins, (Ajax implemented) that
might be worth utilizing?
Thanks
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2011 Oct 21
20
How to transform my html form into a rails 3 form
Hi,
I have the following code working in a rails 3 view, but it is
unfortunately not pure rails code!
<% @filter1 = "tr.show1,tr.show2" %>
<% @filter2 = "tr.show1" %>
<% @filter3 = "tr.show2" %>
<form>
<p>
<input type="checkbox" value=<%=@filter1%> onclick="$
(this).is('':checked'')
2010 Sep 23
8
HowTo; Rails 3, having Tabs that load content via jQuery ... No Page Refesh
Hello, I''m interested in learning the correct/smart approach for
implementing a web page with tabs and a content panel... When the tab
is clicked by the user the tab''s content is fetched and inserted with
jQuery... no page refresh...
Example, Facebook, when you click Photos or Events, it doesn''t refresh
the browser, just replaces the content with AJAX in the
2010 Sep 17
25
Trying to look up comment through an ID, but failing
I am trying to allow users to reply through comments by allowing users
to click a reply link next to the parent comment. It will send in a
parameter to the ''new'' comment view, like so:
| <%= link_to "Reply", new_comment_path(:in_reply_to => comment.id) %>
The form will use the :in_reply_to parameter in order to save that id as
the parent id, like so:
2010 Sep 21
7
Ajax CSRF in Rails3
I''m using rails3. It does not seem to check the authenticity_token
when doing a POST using Ajax. I traced this to:
module ActionDispatch
class Request < Rack::Request
.....
def forgery_whitelisted?
get? || xhr? || content_mime_type.nil? || !
content_mime_type.verify_request?
end
end
so you don''t check if its a get? or a xhr? (ie ajax request). Is this
correct?
--
2011 Mar 10
4
Multi-model forms
Hi guys, I''m new to ruby and rails and I''m working on multi model
forms, specifically 3. I''m using this http://guides.rubyonrails.org/getting_started.html
as a start, and its got a 2 Model example but I cant seem to get the
last one working.
These are my models:
Country name:string code:string (has_one :address)
Address address_line1:string
2010 Dec 27
6
RVM Issue
I''m a total rails newb and is trying to install RVM. The terminal
tells me that RVM installed just fine but when I try commands like
"rvm notes" or "rvm install 1.9.2" I get: "-bash: rvm: command not
found"
Does anyone know why?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to
2010 Sep 18
11
Commenting in an ERB without generating a compiling error
Hello,
I have the following:
<% @projects.each do |project| %>
<tr>
.
<td><%= link_to ''Destroy'', project, :confirm => ''Are you
sure?'', :method => :delete %></td>
.
</tr>
<% end %>
How can I safely comment out the TD line above? Do I have to use the
=begin way?
--
You received this message because you
2010 Sep 11
4
Can't install plugins on rails 3.0
Just upgraded one of my apps to Rails 3.0 and I cannot install
plugins. I either get "Plugin not found", or an empty folder.
When I run
rails plugin --verbose install http://github.com/jslag/us-state-select-plugin.git
I get this response:
Plugins will be installed using http
git init
git pull --depth 1 http://github.com/jslag/us-state-select-plugin.git
But all I get is an empty
2010 Sep 27
6
Rails 3 + jQuery ; How to show error messages
Hi guys,
can anyone explain how to show error_messages_on (like back in Rails
2 , without Ajax) fields that didnt'' pass the validation the jquery
way.
I googled for about 2 hours now and found nothing. Jquery works fine
and adds the content to my table, but im totally stuck with the whole
error/validation thing.
My form looks like this:
<%= form_for Translation.new , :remote =>
2011 Sep 10
4
Finding HTML attributes with jQuery in Rails 3.1
I''m having trouble wrapping my head around the proper syntax to have
jQuery (in an .js file) grab an HTML attribute and use the value of
that attribute to load a partial.
HTML fragment:
<a href="/toggle" data-remote="true" section="training">
jQuery string (now setting a static partial, I need this to be
dynamic)
2010 Dec 21
8
Rails - escape_javascript without all the \n\n\n\n\n
Hello, I''m using escape_javascript to return a partial to the browser
via ajax.
Something like:
$("#inject").html("<%=escape_javascript(render :partial =>"feed/
index")%>");
Problem is escape_javascript ends up outputing all kinds of wasted
space like
\n\n\n\n\n \n
Is there anyway in Rails to escape_javascript more
2010 Sep 13
13
what I've missed in routes.rb?
In routes.rb I''ve put:
resources :sessions
controller is:
class SessionsController < ApplicationController
def destroy
session[:id] = nil
session.delete(:casfilteruser)
CASClient::Frameworks::Rails::Filter.logout(self)
end
end
In application.html.erb I have:
<%= link_to ''Logout'', session_path(session[:cas_user]), :method => :delete %>
I
2011 Jun 15
5
rails 3.0.9
Today was expected the new stable rails release 3.0.9 with some fixed,
among all the problem with escape_javascript.
It seems that it see that has not been released, unfortunately.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2011 Feb 17
9
Page Caching... extending it???
Hey there
Is it possible to intercept Action Cache to force it to use a
specified filename to save to.... or to load a specified cached file
that is different to the current one expected for the URL?
I guess this is some sort of "extending" of action cache.... but I
cannot find much in google :)
thanks
--
You received this message because you are subscribed to the Google Groups
2010 Sep 09
17
formtastic issue
Hello,
I will try to explain it step by step :-)
I just created a new rails 3 app, then I created a new controller...
rails generate controller admin::users
I didn''t forget to add the resources in the routes.rb file like this.
namespace :admin do
resources :users
end
Now I try to use formtastic to create the form but I get erorr that my
users_path doesn''t exist?