error
Routing Error
No route matches [GET] "/_sproutcore"
routes.rb
bulk_routes "/api/bulk"
doubt
i did exactly as directed in http://sproutguides-drogus.strobeapp.com/rails.html#authorization , but while doing rails generate bulk:install instead of
route bulk_routes "/api/bulk"
route mount Bulk::Sproutcore.new => "/_sproutcore"
create app/bulk/application_resource.rb
create config/initializers/bulk_api.rb
it just does
route bulk_routes "/api/bulk"
create app/bulk/application_resource.rb
create config/initializers/bulk_api.rb
According to https://github.com/drogus/bulk_api, the bulk_api gem is deprecated and no longer maintained which is probably why it isn't working. The developer points to some additional resources that may be useful.
Related
I'm getting this error when I try to use redirect_via_turbolinks_to in my controller
undefined method `redirect_via_turbolinks_to' for
I extracted this method from the doc:
Triggering a Turbolinks visit manually
You can use Turbolinks.visit(path) to go to a URL through Turbolinks.
You can also use redirect_via_turbolinks_to in Rails to perform a redirect via Turbolinks.
I'm using turbolinks '1.3.1' in rails 3.2.14
Turbolinks.visit(path) can be used in your JS/Coffee assets or within some embedded JS:
$ ->
$(document).dontBeNaughty()
jQuery.fn.dontBeNaughty = ->
$(".ReportsHistory").on "click", ->
action = $(this).data('url')
Turbolinks.visit("/reports?" + action)
You can use the redirect_via_turbolinks_to in your controller instead of rendering a template.
More information can be seen in the source of turbolinks here:
For anyone that comes across this, redirect_via_turbolinks_to is deprecated in favor of redirect_to url, turbolinks: true
Source: https://github.com/turbolinks/turbolinks-classic/blob/master/CHANGELOG.md
I feel like this should be a simple problem, but I'm pulling my hair out trying to track it down. I'm installed the chargify_api_ares gem, but can't do even basic things such as
Chargify::Subscription.create
As I get this path error. I feel like this must be a gem issue somehow but don't know where to go from here.
UPDATE: bundle show chargify_api_ares shows the correct path, I just somehow can't access it. Still trying random environment related things.
Looks like this is the source of the problem, in active_resource\base.rb:
# Gets the \prefix for a resource's nested URL (e.g., <tt>prefix/collectionname/1.json</tt>)
# This method is regenerated at runtime based on what the \prefix is set to.
def prefix(options={})
default = site.path
default << '/' unless default[-1..-1] == '/'
# generate the actual method based on the current site path
self.prefix = default
prefix(options)
end
As I understand it, Chargify.subdomain should be setting the site.path, but I don't understand activeresource well enough yet to know what's happening and will continue to dig.
I too had the same issue.
I executed the following on the console
Chargify.configure do |c|
c.api_key = "<<api_key>>"
c.subdomain = "<<subdomain>>"
end
After that performing any Chargify console commands went through fine.
This is the query generated by Mongomapper:
MONGODB mydatabase['users'].find({:name=>"bob"}).limit(-1)
But this is not valid in the mongo console since the correct syntax is
db.users.find({:name=>"bob"}).limit(-1)
If I just use the generated one, I got this error in the console
Thu Jan 12 03:01:23 ReferenceError: mydatabase is not defined (shell):1
Is there any way to make it correct? This causes my rails application broken.
You can't use symbols in the MongoDB console as they are ruby and not javascript :-) Try this:
db.users.find({name: "bob"}).limit(-1)
It is not mongodb's issue. 406 is pretty much relating to the controller call.
I need to use:
render :json => #user
rather than
respond_to
I encountered strange problem - when Im trying to get User information from SalesForce using databasedotcom gem like this:
owner = client.find("User", deal_from_sf.OwnerId)
I get ActiveRecord error ActiveRecord::RecordNotFound for User, id:0013000000XXXXX
How can I use this method without patching native gem (as I understand alias for find method will help)?
The answer is so simple - read the documentation!!!
The problem obviously was in the namespace which was Global by default and User treated like ActiveRecord model. But one should add just one line to salesforce.yml file:
sobject_module : YourModuleName
and specify module where your salesForce logic lives)
http://rubydoc.info/github/heroku/databasedotcom/master/Databasedotcom/Client#sobject_module-instance_method
I am using Rails 3 and AJAX and have a parent object which is being created through and AJAX request. This parent is sent with children and saves them all. However, if a child has an error, Rails will stop the request. Is there any way to tell Rails to ignore this? I understand the proper thing to do is find the problem within the Javascript sending the request and fix it. However, for the sake of learning, is there a way to tell Rails that some errors might be ignorable?
To save without validating use:
#parent.save(:validate => false)
Also, don't forget you can create conditional validation rules if needs be. For example, add a virtual attribute (an instance variable that is not persisted to the DB) accessible via bare_bones?. Then modify a validator like so:
validates_presence_of :nickname, :unless => "bare_bones?"
Then, in your controller you would do something like this:
#parent = Parent.new params[:parent]
#parent.bare_bones = true
#parent.save()
Hope this helps.
You are looking for exception handling.
begin
#code that may contain errors
rescue
#what to do if an error is encountered
end