Ruby on Rails - undefined local variable or method - wice grid haml show_code | Fixed issues |
- Ruby on Rails - undefined local variable or method - wice grid haml show_code
- Pass rails object value into span title
- Submitting a form using jquery doesn't submit it as remote: true rails 4.2
- Rails 4: Stop redirect after create or update form
- Ruby: http POST with nested params not working
- Heroku db:setup returns ECONNREFUSED: connect ECONNREFUSED 50.ipaddress:5000
- Rails 3: url helper always raise errors in models or console, but work fine in controllers/views
- GRAPE API + Interactors + current_user
- What is the use of active type gem & nested attributes in rails?
- How to match multiple patterns with Dir.glob?
- Rails content_tag method
- Rails - Need rails reports [on hold]
- Ruby on Rails adding PDFs to partials
- Rails search table clickable link
- logrotate appending the date to logs in wrong way
- How to search one column in searchkick
- TinyTDS: Server name not found in configuration files
- What does yield do in this Ruby method?
- rails5 doorkeeper+devise, return invalid_redirect_uri error
- Twilio Say when putting conference on hold
- spaghetti code - how to fix my db calls
- Ruby Mysql2 Client not taking backslash while insert
- Rails query execution causes database spikes
- Multiple addresses in rails geocoder issue
- OpenSSL::SSL::SSLError hostname does not match the server certificate rails 2
- rails Cannot nest nested form with parent form in index page
- Typhoeus - Couldn't connect to server
- Rails - devise and sidekiq routes
- Route to Current User Edit in a view
- Prawn Rails, generate table with some content not bound by table
Ruby on Rails - undefined local variable or method - wice grid haml show_code Posted: 03 Aug 2016 07:53 AM PDT I am new to ruby on rails. I am trying to get haml and wice_grid to work together. I am using this example as a model: http://wicegrid.herokuapp.com/basics3 I get the error 'undefined local variable or method `show_code' for...' In the file app/views/basics3/index.html.haml which you can see at the link above. Am I missing a gem? In general, what is the best way to troubleshoot problems like this? Thanks in advance- Flex |
Pass rails object value into span title Posted: 03 Aug 2016 07:53 AM PDT I want to be able to pass an object value into the title of a span element however when I use the below code on hover #{campaign.status} is displayed rather than Aprroved or Rejected as is my intention. |
Submitting a form using jquery doesn't submit it as remote: true rails 4.2 Posted: 03 Aug 2016 07:52 AM PDT I have to submit a form when user clicks a button for that I'm using an onclick JS function call on that button. In that function, I simply submit the form I want using JS function I use, Also in the Controller also has proper View file has proper But whenever I click the button it is being processed as HTML. If I manually click on that form's submit button it's processed as JS successfully. How to fix the issue?? |
Rails 4: Stop redirect after create or update form Posted: 03 Aug 2016 07:44 AM PDT Someone know how can I do to Rails do not redirect to other page when I create or update a form? This is because I'm using remote: :true to update the form by ajax. end [...] If I just remove the redirect function I get the error: Thanks! |
Ruby: http POST with nested params not working Posted: 03 Aug 2016 07:47 AM PDT I am trying to do Http Basic Authentication with POST and nested parameters. While the outer parameters work fine (class.name - ActionController::Parameters) the nested parameters are string (class.name - String) Here is my code -> What other library can I use to make the nested params work without having to manually convert them. I see that |
Heroku db:setup returns ECONNREFUSED: connect ECONNREFUSED 50.ipaddress:5000 Posted: 03 Aug 2016 07:23 AM PDT Was making my first rails app and after pushing files to heroku, tried to run the db setup, but it dies with this message:
Is it my/server firewall causing this? What can be done? Any kind of help is really appreciated. Here are heroku logs |
Rails 3: url helper always raise errors in models or console, but work fine in controllers/views Posted: 03 Aug 2016 07:49 AM PDT To be clear, I can call these url_helpers, and what I tried works fine on other projects: it's not an A simple Calling a model method using url_helpers from a view or a controller will also raise the same exception, so I don't think it's due to the lack of request. The project is using rails 3.0, and what I tried works fine on other rails 3.0 projects. |
GRAPE API + Interactors + current_user Posted: 03 Aug 2016 07:19 AM PDT How to enable 'current_user' in grape controllers? I'm using interactor gem and I'm going to 'create Item' with 'user id' param. I want to associate Item with current_user: item.user_id = current_user.id. How to do that? |
What is the use of active type gem & nested attributes in rails? Posted: 03 Aug 2016 07:13 AM PDT I have five models named as(user,load,load_types,truck_types,company) from this i would like to create one controller name as load acquisition without a model.Here i want's to use the gem active_type and nested attribute concept for create&updating process. My fields in above four table. How to use the active_type gem in my rails app with nested attributes concepts. |
How to match multiple patterns with Dir.glob? Posted: 03 Aug 2016 06:54 AM PDT In my Rails app I am trying to collect the paths to all the files contained in two different directories using The following code works but is not very concise. Isn't there a way two match two patterns at once with |
Posted: 03 Aug 2016 07:13 AM PDT I was browsing the source code of this gem and I found a use of content_tag that confuses me a lot. I do not understand why content_tag is called on view. I generally use it as helper to generate HTML tags, but I've never called it as a method. |
Rails - Need rails reports [on hold] Posted: 03 Aug 2016 06:31 AM PDT I have two models Tourists and Country and i need following queries. I have has_many :tourists and belongs_to :country assocations. |
Ruby on Rails adding PDFs to partials Posted: 03 Aug 2016 06:17 AM PDT I have a rails form that a user fills out, and later they can print it off as a PDF. The content is very similar (removed navbar and links, etc). Now I need to add PDF documents at specific locations of the PDF version of the form. For example, take a form for a rental application that has the property details, first tenant details, pdf document, followed by a second tenants details, another pdf document. I'm currently using PDFkit to generate PDFs from html. But I'm open to suggestions. Thanks, |
Rails search table clickable link Posted: 03 Aug 2016 07:21 AM PDT I have a keyword search page for which the results are presented in a table. One of the fields in this table is a url which I want to display as a clickable link when the field has one in it but I can't get this working, when the link is clicked it instead queries the search again. I think the problem is due to the def within the searches controller dealing with the keywordsearch view. Can anybody help? Below is the keywordsearch view which contains the results table: Below is portion of the search controller in which keyword search is defined: The link from all of this is clickable but rather than taking me to the correct url it redoes the search. |
logrotate appending the date to logs in wrong way Posted: 03 Aug 2016 05:58 AM PDT I have a rails application and I have setup logrotate for the logs. The logs are like Below are my configuration for logrotate
Any help? Basically I want the log file should be named like |
How to search one column in searchkick Posted: 03 Aug 2016 06:31 AM PDT I'm trying to just search one column. (to adapt upon in the future to search dates and location and event type) I'm using searchkick, Which works lovely however i can search the location when all i want is the event name passed back, However i'm wanting to use the location and others later on. Any help would be great! Any ideas? Sam |
TinyTDS: Server name not found in configuration files Posted: 03 Aug 2016 07:48 AM PDT I keep seeing this error, and I am unable to connect to the database on the remote server. I am given a connection string to the database, that looks like the following: Now, I have created a And as I try and run the server, it always hits me with the Server name not found in configuration files error. Please try and help me figure what is the problem with this? UPDATE: I can connect to the server using It works from the wizard, but not from code using TinyTDS! |
What does yield do in this Ruby method? Posted: 03 Aug 2016 05:52 AM PDT I have a bit of old code in a legacy app which uses |
rails5 doorkeeper+devise, return invalid_redirect_uri error Posted: 03 Aug 2016 05:23 AM PDT I want to use doorkeeper and devise to be the single user service. So I create server-app and client-app. When I click I tried many times and watch others example apps , but I don't know why. Server-app Gemfile ``` doorkeeper.rb ``` client-app gemfile devise.rb ``` config.omniauth :doorkeeper, '62ec3482b200c919d8f8b4200b835750fa1350b73c1738fc2eeb7aba853c27eb', '01bf2d73fa35dd96284dd029bd8151e0862382b2874737e83c1419fc693dd010' |
Twilio Say when putting conference on hold Posted: 03 Aug 2016 05:47 AM PDT I am able to put the conference call on hold, but I would like Twilio to say something like 'This call has been put on hold' to all participants before the music starts playing. I've been trying to do something like this, but it's not working: Anyone know how to achieve this? Thanks. |
spaghetti code - how to fix my db calls Posted: 03 Aug 2016 05:16 AM PDT My db calls are like this: and it looks ugly, not speaking about hound issues. How to fix it? Could you please suggest different approach? |
Ruby Mysql2 Client not taking backslash while insert Posted: 03 Aug 2016 07:27 AM PDT We are using production and staging databases in our application. Our requirement is to insert all the records to staging database when ever a record is added in production database, so that both the servers are consistent and same data. I have used Mysql2 client pool to connect to staging server and insert the record that is added to production. here is my code: Here " like : when I manually execute the "Insert" query in mysql command line it inserts as it is along with \ slash. but not through "client.query" Why does Thanks. |
Rails query execution causes database spikes Posted: 03 Aug 2016 05:05 AM PDT I'm having a problem with my Rails application where some random queries take around 5 seconds or longer to finish. Most of the time the queries are very simple ( Here's some more information about the setup:
I found this out when looking at the query performance in Appsignal. I noticed most queries finishing in a few ms and then every now and then, still in the same request, there are multiple queries that take 5+ seconds to finish. And the odd part is that it ALWAYS takes 5,.. seconds. Here's a picture of that in action: Things I've tried:
I'm noticing this in the application as there are some pages that take a long time to load (I have a function call that takes about 1 minute to finish) and somehow this is blocking new requests. This is strange to me as there are 4 workers each with 8 threads = 32 threads that can handle the other requests. |
Multiple addresses in rails geocoder issue Posted: 03 Aug 2016 06:40 AM PDT I have a booking model with location_pickup and location_dropoff on which i want to use the geocoder feature. I have declared the geocoder mapping in the model (below), but somehow only the last declaration(location_pickup) is getting updated in the database. Anything specific I am doing wrong here? |
OpenSSL::SSL::SSLError hostname does not match the server certificate rails 2 Posted: 03 Aug 2016 04:41 AM PDT I'm trying to make an API call to SmartDebit a 3rd party direct debit processing website from my Ruby 1.9.3, Rails 2 app. I'm getting this error: The error occurs here: "https://onepointnine.survivalinternational.org/donate" when trying to make a direct debit payment. As far as I can tell my SSL certificate is correctly set up and valid for this hostname, Smart Debit have confirmed that the error doesn't refer to their endpoint. Also, the error can't be to do with certificate verification because I already have this code in an initializer (n.b. I realise this isn't best practice, I've inherited this codebase): Any idea what's wrong? |
rails Cannot nest nested form with parent form in index page Posted: 03 Aug 2016 04:55 AM PDT index.html.haml I have to display customer detail list in index page.I want the nested form 'goods address' fields also to be listed in index page |
Typhoeus - Couldn't connect to server Posted: 03 Aug 2016 04:27 AM PDT I have a typhoeus call like so in my rails app - Typhoeus::Request.get("http://abcd.data_center1/v1/return.json"), which works fine. Now we are migrating the code to a new datacenter but for this endpoint we want to still use the same datacenter as above. When hitting the above with typhoeus I get - but I am able to ping the endpoint just fine. What could be the issue here? TIA |
Rails - devise and sidekiq routes Posted: 03 Aug 2016 04:40 AM PDT I am running a Rails 5.0.0 app with Ruby 2.3.1 Sidekiq is being used for background jobs and devise for authentication. Sidekiq monitoring and devise are mounted in routes as follows: But, accessing the sidekiq status page logs out the user. The same code used to work fine with Rails 4.2.5 |
Route to Current User Edit in a view Posted: 03 Aug 2016 05:45 AM PDT What is the syntext I need to use in order to route to edit the current user's profile? I want to put a link on my page that takes you to edit your user profile. I know how to link_to but not sure what what the syntex is to get to the current user. My Users controller looks like this: And In my routes file I have: |
Prawn Rails, generate table with some content not bound by table Posted: 03 Aug 2016 04:14 AM PDT I am trying to build a fairly complex pdf using Prawn in Rails. The document I am trying to generate is a form of script split into four columns. The script is comprised of a collection of 'snippets', which are iterated through and populate the third column. If a snippet has special properties it can also populate any one of the other three columns as well. This is all achieved very easily using tables. However, I then need to be able to draw an arrow of some description (using prawn graphics) at certain points spanning between the table columns (please see attached image). How is this achieved since content is bound by table cells? Is there a way to later draw these lines using cursor points or some other method? Please ask for further for clarification if I'm not making any sense. Thanks |
You are subscribed to email updates from Newest questions tagged ruby-on-rails - Stack Overflow. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment