Questions tagged [actionviewhelper]

For questions about helper classes for the Ruby on Rails module Action View.

For questions about helper classes for the module .

86 questions
0
votes
1 answer

How to use collection select as a button in Rails?

In my form I have a collection_select to be able to select the name of the articles, my problem is that when I select any article nothing happens <%= form_with url: articles_path do |f| %> <%= collection_select(:article, :article_id, @articles,…
Samuel Da Costa
  • 415
  • 3
  • 17
0
votes
2 answers

View Helper in Kohana

I am trying to figure out a way to do the following: I want to make an action which will be loaded through ajax and also its the internal part of the page when page is reloaded. I know this in ZEND framework by using View Helper, But don't know how…
jimy
  • 4,848
  • 3
  • 35
  • 52
0
votes
1 answer

Can't access the image through data-image property

I am facing trouble with this div element during loading the image. 404(Not Found) Here is my code in Views. I am not familiar…
0
votes
1 answer

How image_tag is overrided and a reason to not add fingerprint

I have rails application, with sass less and many gems. I try to find where image_tag is overwrited to debug why it do not add fingerprint hash to url. I have done rails assets:precompile and files with hash fingerprint are existing in public…
fl-web
  • 462
  • 5
  • 16
0
votes
1 answer

Rails 5 tag helper with tag name in variable

I am converting some older code which uses content_tag like this: wrap_tag = 'p' .... content_tag(wrap_tag, class: 'etc') do 'some content' end which generates the expected

Some content

I'd now like to update to use the…
Anita Graham
  • 456
  • 1
  • 5
  • 13
0
votes
1 answer

Plugin not found with custom view helper

I need some help with a custom view helper. My folder structure is like this: application - modules - - smjestaj - views - - helpers - - - LoadSkin.php And if I go to localhost/smjestaj I get this error: Message: Plugin by name 'LoadSkin' was…
davs
  • 144
  • 1
  • 2
  • 10
0
votes
2 answers

How to use the `link_to_unless_current` helper to work for both current or root path?

I am setting up my navbar link_to's and I'm trying to stop a link being rendered if current_path is the same as link_path or if current path is the same as root path, as root path is defined as that same as the link path, as below: _navbarhtml.erb …
jbk
  • 1,911
  • 19
  • 36
0
votes
1 answer

What is the mechanism behind view helpers?

I wonder what approach Rails uses to find the correct method of a view helper. I recognized while calling a view helper method in a partial that the view helper must not belong to the same view nor must it have a similar name, the method is always…
medihack
  • 16,045
  • 21
  • 90
  • 134
0
votes
1 answer

How to use helper methods to access elements from options_from_collection_for_select

The docs state options_from_collection_for_select(collection, value_method, text_method, selected = nil) has to have elements that respond_to? the value_method and the text_method. What if my collection is an array of hashes and I need to use some…
absessive
  • 1,121
  • 5
  • 14
  • 36
0
votes
1 answer

Create data structure for grouped options

I have MyModel with two attributes, a :label string and an :group integer which groups these strings. The labels for these groups come from an array of strings GROUP_LABELS. For my html view, I wanted to create a select control with grouped…
wribln
  • 355
  • 2
  • 13
0
votes
2 answers

Rails: Using roo in model to load a table, keep getting: NoMethodError: undefined method `asset_path'

I'm trying to provide an interface to "pre-load" a table from a spreadsheet file. Sounds simple, but I'm making heavy weather of it, being a complete novice. I have used the action_view helper asset_path to locate the file after it is precompiled in…
FBtLL
  • 1
  • 1
  • 2
0
votes
2 answers

rails helper nested content_tag with span inside link_to

Hi i have tried almost everything and cant get this to work. The title.capitalize part doesnt get displayed. I tried using "+" but then i get error about expecting end keyword def mailbox_section(title, current_box, opts = {}) content_tag :li,…
minohimself
  • 496
  • 3
  • 9
0
votes
1 answer

how to add styles to actionview helper tags?

how do i add styles to actionviews helper tags. like the following <%= link_to "Home", :controller=> "home", :action=> "index", :style=>{:position=>"absolute", :top=>"0px"} %> is something like the above achievable. I dont want to add css…
ZX12R
  • 4,760
  • 8
  • 38
  • 53
0
votes
1 answer

Rails form_for method not responding to html options

I have an active model model that I would like to use form_for with. form_for(@item, url: (params[:action] == 'edit' ? api_item_path(datasheet_id: params[:datasheet_id], item_id: params[:item_id]) : api_items_path), html: {method: (params[:action]…
user2536065
0
votes
1 answer

Why Gmaps4rails' marker.picture not showing the customized image of the marker?

I placed the the custom icon in assets/images/logo.png and in the controller there is : marker.picture({ "url" => "logo.png" , "width" => 32 , "height" => 32}) I even tried replacing logo.png by \assets\images\logo.png but it does not…
Hamza Ouaghad
  • 589
  • 10
  • 23