Displaying 20 results from an estimated 3000 matches similar to: "Can I omit respond_with."
2011 Jan 23
1
Force UTF-8 encoding
I''m writing an upload script for contact management, but having encoding
issues:
#=> Encoding::UndefinedConversionError: "\xFA" from ASCII-8BIT to UTF-8
I will not always know the encoding supplied, and this is the result of
`some_string.encode("UTF-8")`
I have also tried .force_encoding("UTF-8") to no avail. For now I''m
simply trying to
2011 Jan 12
14
WickedPDF vs PDFKit vs. Prawn, etc.
Thoughts on using WickedPDF vs PDFKit vs. Prawn or others for developing
forms with dynamic content?
TIA,
Garrett Lancaster
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2011 Jan 10
8
Creating a Dynamic/Custom form
I am pretty new at rails and seem to be stuck on an issue.
Trying to find a way to get me app admin to create a form on our rails
app. These would include:
- Select form control type
- Select required validation
- Select price change if selected
How should I even start going at this?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2011 Apr 18
1
has a field through an association
Hey guys,
Trying to figure out how to do something like the following:
class Child
belongs_to :parent
has_field :some_field, :through => :parent
end
class Parent
has_one :child
attr_accessible :some_field
end
child.some_field #=> parent.some_field
child.some_field = value #=> sets parent.some_field = value
I can of course accomplish this by adding custom accessors
2013 May 23
1
problem of respond_with working on nested resources
hi all:
when using namespace or nested resources in routes.rb,such as
"namespace :admin { resources :books }, we can use [:admin,@book] way to
generate path. It works fine in form_for , but when I use it with
respond_with in controller, I get problems.
The problem is when I put following code in controller:
def create
@book=Book.find(params[:id])
2012 Sep 18
4
"best practices" for Rails serving RESTful JSON services for use by AngularJS, Ember.js, etc.
I''ve been writing a gem to implement and extend common controller
functionality so that Rails can be used with Javascript frameworks like
AngularJS (which we are using), Ember.js, etc. in such a way that the user
doesn''t have to tweak a a bunch of rails g controller boilerplate code to
provide services for use in these frameworks that in turn would require
various changes to
2011 Jan 15
3
respond_with javascript
My ajax stopped working when I switched to using respond_with. For my
Votes, I have the create action and the corresponding create.js.erb,
and respond_to :html, :js, :xml in the controller. Heres the log when
I try and create a vote:
Started POST "/stories/3-asdfasdf1111/votes" for 127.0.0.1 at Fri Jan
14 20:46:36 -0800 2011
Processing by VotesController#create as */*
Parameters:
2011 Jan 21
3
File Column open tmp file
Does anyone know how to open a file like the below?
"Filedata"=>#<File:/var/folders/9D/9D8PtWGBFgmSvF-Ue+uD9++++TI/-Tmp-/RackMultipart20110121-7108-6aqdij-0>}
file_column is used to upload a document and i need to open it just with
the information above,
Any ideas?
JB
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the
2010 Dec 25
6
undefined local variable or method?
I have:
<%= form_for(@supplier) do |f| %>
.......
......
<%= render ''sector_categories'', :locals => {:f => f} %>
in _sector_categories partial I have:
<div class="field">
<div id="category_update">
<% for category in @categories %>
<%= f.check_box :category_ids[], category.id,
2012 Nov 26
8
why functional test does not get failure?
The test:
test "should get new" do
get :new, :room_id => @room.name
assert_template(:ne)
end
the template new does not exists but the test does not get failure.
Why?
--
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
2009 Dec 02
14
root_path and root_url undefined
Hi all,
I''ve just started working on another RoR project after a couple of months
away. I''m having trouble with named routes, specifically root_*
In previous apps I''ve used root_path and root_url without any problems, but
in this project (2.3.2 - the same as my last project where I used it) it
comes up undefined.
I''ve double and triple checking my routes.rb,
2012 May 10
6
Is it suitable using STI?
I have problems on a simple design problem.
I have many companies. Each company have one or more commercial activity.
Activities types are: ecommerce, local unit, television, automatic
vending machines, and so on.
Company may have one or more ecommerce activity or one or more local
unit activity, one ormore vending machines, etc.
How can I model this scenario?
Company has_many ecommerce has_many
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 Jan 08
9
options_for_select.
Even reading the documentation I can not figure out what is the
select_tag difference between this:
<% = select_tag (bags [], "options_for_select (bags.collect @ {| bb |
[bb.bag_type, bb.id]},
ruser.bags.collect @ {| ub | ub.id}), {: multiple => true,: id =>
"bags"})%>
and this:
<% = select_tag "bags [], " options_for_select (bags.collect @ {| bb
2011 Feb 10
2
Menu definition problem
Hi,
I''m currently in the process of switching from my previous web page
management tool (by coincidence also called "webgen" ;-) to webgen-0.5
and stumbled upon a problem regarding the definition of menus, which
I can not resolve either by the online documentation or the previous
posts in the different groups (maybe it is a too trivial question?)
I want to define a standard
2011 Sep 09
0
respond_with and ajax
Suppose I have this controller:
class SalesController < ApplicationController
respond_to ?????
def get_price
@price = Product.find(params[:product_id]).price
respond_with ?????
end
end
1) What do I specify for respond_to() so that get_price() will accept
ajax requests?
2) What do I specify for respond_with() if all I want to do is return
@price?
--
Posted via
2010 Nov 21
0
api respond_with json
Hello,
So let say I created this class with the following method that responds
to xml or json.
class UsersController < ApplicationController::Base
respond_to :html, :xml, :json
def index
respond_with(@users = User.all)
end
def create
@user = User.create(params[:user])
respond_with(@user, :location => users_url)
end
end
How do I call the create action from another
2011 Sep 26
2
how to convert from xen .cfg files to libvirt xml?
I have a .cfg configuration file for a xen virtual machine.
I need to convert it in xml format to use with libvirt.
So I run virsh domxml-from-native xen-xm backupsrv.cfg but I have an error:
error: Unknown failure.
How can I investigate about the error?
2010 Jun 27
0
[rspec-rails-2] conflict with view isolation and respond_with
Hey all,
For those of you interested in view isolation in controller specs, an issue has been reported with ActionController''s new respond_with method. Please take a look at http://github.com/rspec/rspec-rails/issues/103 and add comments if you have any thoughts on the matter.
Thanks,
David
2011 Aug 15
2
respond_with with templates and http status when creating an object
Hi.
When you use respond_with in a controller #create method and want to render
XML the response gets the http status 201 (Created).
But if you use a view to render this XML response_with uses the status 200
(Ok), for example when you use the gem rabl.
I cannot determine if this matter is related to Rails or rabl. If it''s from
Rails, is there a particular reason for this behavior?