Issue I’m writing an app where I want all requests for HTML to be handled by the same controller action. I have some other routes that are JSON-specific. Here’s what my routes look like: Blog::Application.routes.draw do constraints format: :json do
Continue readingTag: ruby-on-rails
Can I remove the default root in a Rails application without creating a new one?
Issue When creating a new Rails application, by default it serves a “Welcome to Rails” page at / unless you specify an alternative root in routes.rb. My application currently only serves things from a subpath (e.g. /api/v1/) so accessing /
Continue readingCan I remove the default root in a Rails application without creating a new one?
Issue When creating a new Rails application, by default it serves a “Welcome to Rails” page at / unless you specify an alternative root in routes.rb. My application currently only serves things from a subpath (e.g. /api/v1/) so accessing /
Continue readingHow can I reload the current page in Ruby on Rails?
Issue I currently have a login popup in my header bar which is on every page in my website. I want to be able to reload the current page that the person is on after a successful login. How do
Continue readingActive Admin: how to add sortable on nested model's json column
Issue How do I pass in a jsonb order query into the sortable: option for an Active Admin column? My model is structured like this: # User Model class User < ActiveRecord::Base has_one :level end # Level Model class Level
Continue readingRails with Alchemy – properly set Cache-Control header
Issue I have an app with Devise and Alchemy CMS and when I sign in, the button Login should change to Logout but it doesn’t. I think that HTTP caching is enabled. If I logout, I get redirected to the
Continue readingRails fresh_when should include current user id in etag
Issue I see many examples like this: def show @article = Article.find(params[:id]) fresh_when(@article) end However the page also contains information (like top navigation) about the logged in user. A user can: log in as user A visit the article log
Continue readingHow can I use Rails' HTTP caching helpers with an `updated_on` timestamp?
Issue I’m working on a new Rails 6 API app (to serve both a React.js front end and other services) that, for historical reasons, shares a backend MySQL database with two other applications that have existed since the early days
Continue readingAngularJS: How to bind a model specified in the view (ng-bind) to a $resource available through an API?
Issue I’m trying to connect (in Angular, at the client) the same database object through its html view, to its equivalent instance through a json API. I have a working api and $resource, and have a working view, I just
Continue readingScope Angularjs $resource parameters to HTTP Hash
Issue By default, Angular’s $resource.$save method sends a request with parameters in the “base” scope. For example, creating resource with properties {name: ‘John Smith’, email: ‘john.smith@gmail.com’} will result in a POST with parameters: name=John Smith&email=john.smith@gmail.com. However, I have a Rails
Continue readingHow to use an angularjs resource for rails/RESTful routes?
Issue I’ve got an angularjs app embedded in a rails app. I’m using the RESTful methods provided by rails for a resource named “Task.” Here are the routes I’m dealing with: GET /api/v1/tasks.json POST /api/v1/tasks.json GET /api/v1/tasks/:id.json PUT /api/v1/tasks/:id.json DELETE
Continue readingCannot read property 'index' of undefined
Issue I am very new to Angular and was trying to use it on my Rails Application. But I got the following error. TypeError: Cannot read property ‘index’ of undefined app.js code angular.module(‘ticket’, [‘ngResource’, ‘ui.router’, ‘templates’]) .controller(‘AppCtrl’, [‘$rootScope’, function($rootScope) {
Continue readingRetain Sass syntax highlighting in Sublime Text 2 when embedding Ruby
Issue I am embedding Ruby in a few Sass files—I have files named, for example, file.css.scss.erb. When I add the .erb extension to these files, I lose the Sass syntax highlighting. Does anyone know how to retain the Sass formatting?
Continue readingValidate value in text_area
Issue I have a text_area in my rails app where users can paste plain text or code. I really don’t want to ask the user to choose text or code for me but want to make it like a WYSWYG
Continue readingsyntax highlighting with coderay, asciidoctor not working
Issue I have asciidoctor markdown like so, as described here http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#source-code :source-highlighter: coderay :coderay-css: class :stylesheet: coderay_railscasts.css.scss [source,ruby] .app.rb —- require ‘sinatra’ get ‘/hi’ do “Hello World!” end —- But my output in the browser isn’t highlighted at all. The
Continue readingHow to use CDN hosted highlight.js using Rails?
Issue Where do I place the following links to get highlight.js to work on my Rails application (https://highlightjs.org/download/)? <link rel=”stylesheet” href=”//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css”> <script src=”//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js”></script> Solution on app/views/layouts/application.html In the middle of head tags. Sometimes is hard to identify something in the
Continue readingGenerate syntax highlighting for markdown in slim
Issue I’m using slim in my rails app to generate my views, and have enabled the markdown engine (with redcarpet) so I can write markdown in my slim files like so: h2#usage Usage markdown: ### Via JavaScript Call the dropdowns
Continue readingRedcarpet Syntax Highlighting
Issue I’m trying to get Syntax Highlighting with Redcarpet working My appliaction_helper.rb: module ApplicationHelper def markdown(text) render_options = { # will remove from the output HTML tags inputted by user filter_html: true, # will insert <br /> tags in paragraphs
Continue readingAny gem for designing a blog post in Rails with syntax highlighting and inline image attachment?
Issue I am trying to make a personal blog in Ruby on Rails. I want to design individual post with syntax highlighting as well as inline multiple image attachment. I have tried ckeditor gem with paperclip but the syntax highlighting
Continue readingHow do I implement Rouge syntax highlighting in Rails?
Issue There are a bunch of tutorials floating around, but they seem to be incomplete or not fully current or don’t fully work for me. This is what I have done. Gemfile: gem ‘rouge’ gem ‘redcarpet’ Then I created a
Continue readingSyntax highlighting issue on multiline code in Sublime Text 3 (Ruby on Rails & Haml)
Issue Syntax highlighting in my html.haml view fails when I break up my code on several lines: Example: Syntax highlighting working on single line: = link_to results_path(keyword), remote: true, rel: ‘tooltip’, title: ‘Voir les résultats Google’ do %i.icon-external-link But on
Continue readingRoR syntax highlighting for Coda 2
Issue I am curious how to get highlighting for RoR syntax. For instance the Gemfile is all one color and difficult to read. Of the themes I did download I modified the .sss files to add syntax highlighting specifically for
Continue readingHow can I apply syntax highlighting to an ActiveAdmin row?
Issue I’m storing Ruby code in a database so that if an administrator needs to tweak the code logic, they use ActiveAdmin to make edits. My app is written in such a way to load & call this code from
Continue readingHow do I make Atom use the desired highlighting for Rails code?
Issue I recently switched to Atom as my text editor and I’m mostly happy with it. One irritation is that I’m coding in Ruby on Rails and it chooses the wrong highlighting much of the time. Atom (at least, my
Continue readingOverriding paranoid verification code devise security controller in RoR
Issue I followed these steps: add this in Gemfile: gem ‘devise-security’, ‘~> 0.16.0’ run this command: rails generate devise_security:install add paranoid_verification in the resource model file: class User < ApplicationRecord rolify # Include default devise modules. Others available are: #
Continue readinghow to reopen a class in gems
Issue I have same class in main application and a gem (mountable engine). I want to reopen the class(defined in main applicaion) in the gem. Main application has app/models/test.rb class Test def original_method end end in Gemfile gem ‘gem_name’ In
Continue readingHow to override a method of a class from a gem in Rails?
Issue I need to override the behavior of the find method of a class from a gem. This is the code in the gem: module Youtube class Display attr_accessor :base def find(id, options = {}) detailed = convert_to_number(options.delete(:detailed)) options[:detailed] =
Continue readingOveride method in gem
Issue I am using AwesomeNestedSet and have a place in my app that calls the parent method on a model instance. In some cases, parent returns nil. That’s fine but in the cases where it does I need it to
Continue readingHow does one make a template system (like Tumblr's) in Rails?
Issue I’ve looked at Liquid and the like, but I cannot find a way to make a “one file” template that can handle all situations. I don’t want to reinvent the wheel, but I will if I cannot find an
Continue readingHow can I convert erb to html?
Issue Imagine in rails I have @template that is an instance of ActionTemplate::View. Question is: How can I convert @template whose @template.source is <%= “hello from erb” %> to hello from erb?? thanks Solution Try this… ERB.new(@template.source).result ERB#new Answered By
Continue readingRendering Liquid Template in Controller
Issue I’m trying to have the “show” action for my pages controller render a Liquid template instead of the normal view. The template itself is stored in the database. This is my show action: def show @organization = Organization.find_by_subdomain(request.subdomain) @template
Continue readingSlim Templating: Is it possible to put two elements on the same line?
Issue I often want to nest elements, such as the following navigation: ul li a(href=”#”) link Name li a(href=”#”) link Name li a(href=”#”) link Name Is is possible to put li and a on the same line? Some syntax like
Continue readingGenerate a dynamic table of contents based on (already) rendered headings with Rails
Issue Many Wikis have it, a table of contents based on the headings from the displayed page. I’m looking for an easy possibility to realize that with Rails. I have different kinds of pages, like dynamically generated ones, processed markdown
Continue readingHow do I share a single index page between multiple controllers in Rails 4
Issue I have created a partial that includes searchable attributes and paging to replace the default rails scaffolded index view. It works great on a single model/controller and now my objective is to share this partial in the DRYest way
Continue readingRails: form_for shortening code
Issue I am currently learning rails and I have the following code: <%= form_for(@account) do |f| %> <%= f.label :username %> <%= f.text_field :username, class: ‘form-control’ %> <%= f.label :email %> <%= f.email_field :email, class: ‘form-control’ %> <%= f.label :password
Continue readingAlgolia InstantSearch Templating: Displaying attribute of object in array within index record
Issue I’m using Algolia to search Post records in my rails application. Each post has_many tag objects. A Tag has an id, name, and other count. Here is an example record in my index: { “id”: 98, “caption”: “How to
Continue readingHow to provide defaults value for partial parameters in Rails?
Issue I need to render a shared partial which can receive a few parameters from several views, but I don’t want to pass all parameters everytime. If I call the template without all parameters, I get an error. Is there
Continue readingrender_to_string in lib class not working
Issue I’m trying to use delayed_job to update a remote database via xml In my lib folder I put a file with a class that should do a render_to_text with template.xml.builder, but I get: undefined method `render_to_string’ for #<SyncJob:0x7faf4e6c0480>… What
Continue readingBest way to handle data attributes in Slim
Issue I was evaluating Slim as a replacement for HAML in a personal project, and it doesn’t appear to handle HTML5 data attributes as gracefully as HAML. I was hoping someone may have also run into this, or may have
Continue readingSingleton method vs. class method
Issue Are class method and singleton method doing the same or different? Here is an example. class C def self.classmethod puts “class method #{self}” end end C.classmethod # class method C c = C.new def c.singletonmethod puts “instance method #{self}”
Continue readingHow to implement a singleton model
Issue I have a site in rails and want to have site-wide settings. One part of my app can notify the admin by SMS if a specific event happens. This is an example of a feature that I want configurable
Continue readingUsing increment(attribute) to set value for user's rating
Issue I’m thinking about writing an app with question and answer model. Answer has increment attribute that anyone can change to change the rating value. So if I click up on answer that someone else posted, the answer will show
Continue readingHelp: Adding rating to existing posts model in Rails
Issue I’ve a simple posts model with title:string and rating:integer and I want to add the ability to rate the posts. So far I have #Post controller def increase @post = Post.find(params[:id]) @post.increment! :rating flash[:notice] = “Thanks for your rating.”
Continue readingRails User Rating Another User
Issue I am working on an application where a user has the ability to leave feedback on another user. Currently, I already have an implemented user model. Is this considered a self referential association? This seems a bit wierd to
Continue readingStar rating in AJAX with Ruby On Rails
Issue I think that acts_as_rateable seems to be quite obsolete and doesn’t support AJAX. I’m looking for a simple “5 star” rating system: is there any plugin or tutorial that can help? Solution Check out ajaxful-rating plugin. Answered By –
Continue readingPrevent users from voting multiple times in Rails
Issue I’ve a simple rating system setup in a blog model. I use a custom method to increase rating, which is integer in blog db. def increase @post = Post.find(params[:id]).increment!(:rating) if logged_in? current_user.increment!(:votes) end flash[:notice] = “Thanks for rating” redirect_to
Continue readingWhat is the appropriate way to handle a rating api/function, in Ruby-on-Rails?
Issue Given the Ruby-on-Rails MVC framework, what is the best way to handle a rating api/function. If I want to give users the ability to rate “stories”, without actually editing them, what would be the best route to take. I
Continue readingHow to design a rating system which permits one vote per user considering the performance?
Issue I am using Ruby on Rails\MySQL and I would like to implement a rating system with the following conditions\features considering a large amount of users and articles: Each article have 3 rating criterias Each criteria is a binary function
Continue readingHow can I order my record partials by rating?
Issue I have a table of venues where each has many reviews and each review has a rating (1-5), my venue index page currently shows all the venues as partials in the order they were created with the oldest at
Continue readingBefore I do this by hand, is there a nice gem/easy way to include things like ratings, favourites, etc. in rails 3?
Issue I guess it’s not so hard to do this by hand, but I was curious if there was easy ways to include concepts like “Ratable” or “Favouritable” and so on. It’s really easy to do by hand I guess,
Continue readingRails Gem: Ajaxful_rating route problem
Issue I’m trying to get ajaxful_rating to work with my rails installation. I have everything running find until a user clicks on a star to rate. When I click a star, the browser url points http://localhost:3000/entries/1/rate?dimension=design&show_user_rating=false&small=true&stars=4 and I get this
Continue readingRails: A Rating Up or Down Counter, Lost
Issue I am currently trying to create a rating counter that has a up or down feature to it. I am confused to if I should add a column to my post to show that a person likes the post
Continue readingRails: current_user.vote_up(@micropost) undefined method
Issue I am currently getting an undefined method for adding <% if current_user.vote_up?(@micropost) == true %>, I am unsure what is causing the error because I defined it here in the micropost controller. Any suggestions? Micropost Controller def vote_up @micropost
Continue readingIntegrate acts_as_rated plugin in rails application
Issue I am creating a user-boards applicationin rails in which a user owns any number of boards and can rate the boards.I want to install acts_as_rated plugin in my rails application. Since this is not available as a gem i
Continue readingrails star rating system – ajaxful-rating
Issue I’m trying to implement a star rating system in my rails application. I’ve opted to use ajaxful-rating gem for this. I’ve installed the Gem I’ve ran the script I’ve added ajaxful_rateable to my gear model to enable rating them.
Continue readingRuby on Rails Rating/Liking Gem
Issue i’m searching Days now for a Rate/Like Gem that allows me to rate/like an image just like the Facebook Like. I’m having that button hovering over my image: and it would be nice if could access the Like Count
Continue readingAdd Ratings and Comments in the same Controller
Issue I have gotten a comment model to work based on railscast 238 but I would like to add voting and rating as well. My current show for the article controller is: def show @article = Article.find(params[:id]) @commentable = @article
Continue readingDevise User Review/Rating System in Rails 4
Issue I’m trying to create a review system on users in rails. I want one user to be able to rate another user on their profile page in devise. I’ve tried a few different methods but I am fairly new
Continue readingInclude associated model for all objects (in index action)
Issue I am trying to develop ratings for my application, where a User is able to set a specific rating for a comment. I have followed the following tutorial in order to do so. Here are my associations: class Rating
Continue readingRuby on Rails – Undefined methods for NilClass
Issue I’m creating a picture-rating app where users can click on pictures and rate them on a scale from 1 to 5. I’m trying to calculate the average rating of a picture. Before when users clicked on a rating value,
Continue readingRuby on rails display star images for the rating system
Issue I have a simple rails application where a user can leave a rating for a product and at the minute I have it so that the average rating is displayed on the index page, so for the book Animal
Continue readingTable column that automatically calculates average rating
Issue I’m following tutorial and have models user, hotel and rating. Users can create hotels, and users can rate them. Users rating value is recorded to table rating together with user_id and hotel_id. When I render partial <%= render “hotels/hotels_list”,
Continue readingRails 4 Rating Inside Model
Issue I’m quite new to Rails and was wondering what option would be best with a system of rating for users: user has_many reviews Each review contains a rating. In order to display reviews count and average rating, is it
Continue readingPosts Rating – Rails
Issue I am implementing rating system in rails for posts. On viewing a post one can rate the post by clicking radio button. Below is the code. Consider only the post and rating don’t consider tags, topics.. And there is
Continue readingRails user rating, can only rate myself
Issue I am trying to set up a 5 star rating system so users can rate other users. At the moment everything is working, (create, delete, update etc…) but only the logged in user can rate himself. I cannot rate
Continue readingRuby on Rails: Order users based on average ratings with most reviews?
Issue I’m able to display the items and their reviews that are within the shop. How do I get the top items with most reviews? My reviews are in another database table than shop and item. Controller @shop = Shop.find(params[:id])
Continue readingRuby on Rails display half a star for a decimal rating, e.g. 4.5
Issue I am able to view 5 asterisks for a rating of 5 for a product, and 4 asterisks for a rating of 4 etc. But what I would like to do is replace the asterisks with an image of
Continue readinguser – rating associations
Issue I’m working on rails project, and i want to create some user rating system, it means that each user has the ability to leave feedback on another user, and the user can also change the score he left behind,
Continue reading10K, 20M, 21V kudos etc… in Ruby on Rails
Issue I am creating a snippet-site where people can rate snippets, just like votes on SO. Currently, when a snippet has over 999 kudos, it looks like on this mug: (source: picocool.com) So what I want is to do a
Continue readingRails 5 Star Rating jQuery Plugin Raty doesn't passing rating value
Issue I’m newbie to rails, and I’m using Star Rating jQuery Plugin Raty to do some review / rating things. For now I’m having a list of data that need to be review, and then the ways to review would
Continue readingUnderstanding Rails with webpacker and incidence on JS
Issue A rails 6 application calls from a legacy application being migrated: <%= javascript_pack_tag ‘zxing.js’ %> <script type="text/javascript"> window.addEventListener(‘load’, function () { let selectedDeviceId; const codeReader = new ZXing.BrowserMultiFormatReader() console.log(‘ZXing code reader initialized’) codeReader.listVideoInputDevices() .then((videoInputDevices) => { const sourceSelect =
Continue readingRails authentication strategy
Issue Hope this is not too broad but after a lot of googling I am not sure where to start. I am looking for a introductory/noob overview to help me get started on building an authentication implementation for a rails
Continue readingAccessing Rails Controller instance variables in CSS
Issue So I’ve seen lots of discussion on SO about using erb in your CSS files. I can get ERB to process the CSS files by using the <%= %> syntax and adding .erb to the file, but what I
Continue readinggetting nil:NilClass when scoping dates in Rails
Issue I’m a bit dumfounded – getting an ‘undefined method `each’ for nil:NilClass’ error. I’ve created a pretty straight-forward scope in the model def self.just_added where(‘created_at > ?’, Time.now-7.days.ago).order(“created_at desc”).first(4) end And a loop in my view <% @just_added_jobs.each do
Continue readingHow to reset ruby class accessors between requests?
Issue I’m working on ecommerce solution, which provides few different shops within a single rails application. There I have a class to hold shop-specific settings. # models/shop.rb class Shop < Settingslogic source “#{Rails.root}/config/shop.yml” def self.init!(shop) namespace shop.to_s load! end end
Continue readingRails routing: Scope using a database field
Issue I am creating an multitenant app based on ideas from Ryan Bigg’s book “Multitenancy with Rails”. In this book, the tenants has their own subdomain. This approach is not applicable in my case, so I’m trying to scope by
Continue readingRuby on Rails ternary operator to display BOTH nil and false
Issue I have 3 roles for User, call it standard, premium, and admin. Each can post posts. Premium and admin can choose whether to make private post or non private post (private: false or private: true). Standard user will not
Continue readingHow to create a scope that is unscoped in Rails 5?
Issue class Foo < ActiveRecord::Base default_scope { where(active: false) } scope :include_deleted, -> { unscoped } This does not work. It returns the scoped documents. alias_method :include_deleted, :unscoped This does not work either: undefined method ‘unscoped’ So, how to define
Continue readingRails: default scoping being cached by query cache?
Issue I got a default scoping like this which is dynamic: default_scope :conditions => [“departure_date >= ?”, DateTime.current.beginning_of_day] When I use this code the first day is ok. Lets say first day is 28-03-2011 But the next day seems like
Continue readingRails ActiveRecord where datetime not working
Issue I have a Model which has_one Schedule (from:datetime, from_a:datetime, to:datetime). I want to retrieve all models that have a schedule that fits the datetime the query is run. For example, I have the model m that has a schedule
Continue readingScope with two parameters rails
Issue I’m following this tutorial to implement a filtering feature in my Rails app. I want admins to be able to filter by age, identifier, and a date interval the users were created. It is the last bit that is
Continue readingRails Mailer: Pass `attachments` to other methods
Issue I’m working on a standard Rails app that uses a mailer to send email. Each mailer class has an attachments attribute [src on GitHub] that aliases an instance variable. I’m trying to pass that attachments reference to a function
Continue readingHow can I use edit_in_place in the show of a different model in Rails?
Issue I have a model Campaign and the campaign/show goes through a loop of the Emails. Campaign has_many Emails. <h2>Emails to Send Today</h2> <% for email in @campaign.emails %> <p><strong>Email: </strong><%= link_to email.title, email_path(email) %> sent after <%= distance_of_time_in_words(email.days.days) %></p>
Continue readingjeditable dynamic target value
Issue I’m using jeditable and it works really great! I’m just having some trouble figuring out how to dynamically change the target URL. jeditable is bound to a table of values that I want to edit inline. So I have:
Continue readingAngular – Error: [$injector:unpr] Unknown provider: IdleProvider
Issue Getting the error Error: [$injector:unpr] Unknown provider: IdleProvider in my application when it is deployed to our staging server using dokku but I am not getting it when running it on my local machine. I’m using ng-idle 1.2.1 I’ve
Continue readingangular-rails-templates: templates are not found
Issue I have a rails application, using angularjs for the client side development. I try to load a template located in `app/assets/javascripts/templates/’: myApp.config([‘$routeProvider’, function($routeProvider) { $routeProvider. when(‘/’, { templateUrl: ‘/index.html’, controller: ‘MainController’ }). otherwise({ redirectTo: ‘/’ }); }]); but I
Continue readingMake Restangular .remove() work with Rails Shallow Routes
Issue Say, I have nested resources as follows, shallow do resources :aalu do resources :pyaj end end Using restangular I get the resources as required using the following Restangular call all_pyaj = Restangular.one(‘aalu’, $stateParams.aaluId).all(‘pyaj’).getList(); pyaj is an element of the
Continue readingPass json with special characters angularjs to ruby
Issue I need to make a search form, where the back end used is ruby and front end is angular. the search query is generated in angular in json format and is passed to ruby via restangular service. Its working
Continue readingHow to serve compile assets with rails and nginx on docker?
Issue I’ve been preparing for production with my rails application and I’m having a lot of trouble with nginx. Compared to development where the assets weren’t precompiled, nothing works now. I use sprockets to handle the css, images and fonts
Continue readingNginx how to serve digest favicon file when request is for non-digest favicon.ico
Issue I’m using Nginx in front of a rails app. Nginx is serving static assets from public with the following location rule: location ~ ^/assets/ { gzip_static on; gzip off; expires 1y; add_header Cache-Control public; add_header Last-Modified ""; add_header ETag
Continue readingangularjs add a model layer
Issue I am using angular with rails backend and I am using $resource to interact backend API. so I have a User service which is a $resource instance App.factory(‘User’, [‘$resource’, function($resource) { return $resource(‘/users/:id’,{id: ‘@id’}); }]) Now I can use
Continue readingrails created_at index isn't using index
Issue I have a model called CacheSync, mysql shows that it has an index: mysql> show indexes from cache_syncs; +————-+————+———————————+————–+————-+———–+————-+———-+——–+——+————+———+—————+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null
Continue readingGroup Users by Age Range in ruby
Issue I’m trying to list the number of users by age-range: Range : #Users 10-14 : 16 15-21 : 120 22-29 : 312 30-40 : 12131 41-70 : 612 71-120 : 20 I was thinking of creating a static array
Continue readingRuby on Rails I18n interpolation
Issue everyone! I have a small validation for my :username field, which should be from 4 to 30 characters. I wrote a validation: :length => { :within => 4..30, :message => I18n.t(‘activerecord.errors.range’) – I wanted to display a single error
Continue readingAsset pipeline not loading script from rails-assets gem
Issue I have added the danial-farid–angular-file-upload library to my rails 4 app via rails assets. The main library loads fine, but sprockets can’t find the shims file it includes for file upload progress. I think this is because the shims
Continue readingNot able to upload a file to Rails server with Angular
Issue So I am using the gem ‘angular-file-upload-rails’ which installs me this Angular plugin: Angular File Ipload Now the code I am using currently to upload my file looks like this: HTML: <form ng-controller=”MediumNewCtrl”> <input type=”file” ng-file-select=”upload2($files)” multiple> </form> Coffescript:
Continue readingWhy is my button not appearing on the page?
Issue I have this form in a partial: <%= form_for current_user.relationships.build(:followed_id => @profile.user.id) do |f| %> <div><%= f.hidden_field :followed_id %></div> <div class=”follow_button”><%= f.submit “Follow” %></div> <% end %> that is rendered to my profile view. Here is the resulting html:
Continue readingChrome user agent stylesheet overwriting my site style
Issue I have the following CSS that styles the link on one of my pages: a:link, a:visited, a:active { color: white; text-decoration: none; font-weight: bold; } However, when I load it, they appear blue in Chrome and white in Firefox.
Continue readingCss changes are not being applied in rails app
Issue I am working on rails app and now I am having trouble. Early when I use to change my frontend styling and apply changes in css then they quickly show up on reload in brower. But in present, don’t
Continue reading.field_with_errors messes up bootstrap styled form
Issue I have used bootstrap 3’s grid system to layout a simple sign up form. However, if a validation in Rails fails, the added div with the class “field_with_errors” messes up my layout. Here’s how a line in my form
Continue reading